From: alegrand Date: Mon, 20 Mar 2006 15:37:16 +0000 (+0000) Subject: Adding a XML graph parser X-Git-Tag: v3.3~3397 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/bfc9b3ffef6e41c90e64b271ed981fabe05676cc Adding a XML graph parser git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1961 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/include/Makefile.am b/include/Makefile.am index a889687c0f..d520ab5b12 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -12,6 +12,8 @@ nobase_include_HEADERS = \ xbt/swag.h \ xbt/config.h \ xbt/cunit.h \ + xbt/graphxml_parse.h \ + xbt/graphxml.h \ \ msg/msg.h \ msg/datatypes.h \ @@ -30,4 +32,7 @@ nobase_include_HEADERS = \ surf/surfxml.h: $(MAKE) -C ../src ../include/surf/surfxml.h +xbt/graphxml.h: + $(MAKE) -C ../src ../include/xbt/graphxml.h + include $(top_srcdir)/acmacro/dist-files.mk diff --git a/include/xbt/graphxml.h b/include/xbt/graphxml.h new file mode 100644 index 0000000000..24a923e6db --- /dev/null +++ b/include/xbt/graphxml.h @@ -0,0 +1,91 @@ +/* XML processor/application API for ../../src/xbt/graphxml.dtd. + * Generated 2006/03/20 16:15:20. + * + * This program was generated with the FleXML XML processor generator. + * FleXML is Copyright © 1999-2005 Kristoffer Rose. All rights reserved. + * (Id: flexml.pl,v 1.45 2006/03/03 19:25:46 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 © 1999-2005 Kristoffer Rose. + * 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. + * + */ + +#ifndef _FLEXML_graphxml_H +#define _FLEXML_graphxml_H + +/* XML application entry points. */ +extern void STag_graph(void); +extern void ETag_graph(void); +extern void STag_node(void); +extern void ETag_node(void); +extern void STag_edge(void); +extern void ETag_edge(void); + +/* XML application data. */ +typedef const char* AT_edge_target; +#define AU_edge_target NULL +typedef const char* AT_node_name; +#define AU_node_name NULL +typedef const char* AT_node_label; +#define AU_node_label NULL +typedef const char* AT_edge_label; +#define AU_edge_label NULL +typedef const char* AT_edge_source; +#define AU_edge_source NULL +typedef enum { AU_edge_isDirected, A_edge_isDirected_true,A_edge_isDirected_false } AT_edge_isDirected; +typedef const char* AT_edge_name; +#define AU_edge_name NULL + +/* FleXML-provided data. */ +extern const char* pcdata; +extern AT_edge_target A_edge_target; +extern AT_node_name A_node_name; +extern AT_node_label A_node_label; +extern AT_edge_label A_edge_label; +extern AT_edge_source A_edge_source; +extern AT_edge_isDirected A_edge_isDirected; +extern AT_edge_name A_edge_name; + +/* XML application utilities. */ +extern int grahxml_element_context(int); + +/* XML processor entry point. */ +extern int yylex(void); + +/* Flexml error handling function (useful only when -q flag passed to flexml) */ +const char * grahxml_parse_err_msg(void); +#endif diff --git a/include/xbt/graphxml_parse.h b/include/xbt/graphxml_parse.h new file mode 100644 index 0000000000..b38c258776 --- /dev/null +++ b/include/xbt/graphxml_parse.h @@ -0,0 +1,46 @@ +/* $Id $ */ + +/* Copyright (c) 2006 Arnaud Legrand. 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. */ + +#ifndef _XBT_GRAPHXML_PARSE_H +#define _XBT_GRAPHXML_PARSE_H + +#include +#include "xbt/misc.h" +#include "xbt/graphxml.h" + +/* Entry-point of the graphxml parser. */ +extern int_f_void_t xbt_graph_parse; + +/* Hook for the different tags. They can be redefined at will whereas + the versions without the _fun can't. */ +extern void_f_void_t STag_graph_fun; +extern void_f_void_t ETag_graph_fun; +extern void_f_void_t STag_node_fun; +extern void_f_void_t ETag_node_fun; +extern void_f_void_t STag_edge_fun; +extern void_f_void_t ETag_edge_fun; + +void xbt_graph_parse_open(const char *file); +void xbt_graph_parse_close(void); +void xbt_graph_parse_reset_parser(void); +void xbt_graph_parse_get_double(double *value,const char *string); + +/* Prototypes of the functions offered by flex */ +int xbt_graph_parse_lex(void); +int xbt_graph_parse_get_lineno(void); +FILE *xbt_graph_parse_get_in(void); +FILE *xbt_graph_parse_get_out(void); +int xbt_graph_parse_get_leng(void); +char *xbt_graph_parse_get_text(void); +void xbt_graph_parse_set_lineno(int line_number); +void xbt_graph_parse_set_in(FILE * in_str); +void xbt_graph_parse_set_out(FILE * out_str); +int xbt_graph_parse_get_debug(void); +void xbt_graph_parse_set_debug(int bdebug); +int xbt_graph_parse_lex_destroy(void); + +#endif diff --git a/src/Makefile.am b/src/Makefile.am index bc304b4c4e..535695926c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,6 +21,10 @@ EXTRA_DIST= \ xbt/heap_private.h \ xbt/fifo_private.h \ xbt/graph_private.h \ + xbt/graphxml_parse.c \ + xbt/graphxml.l \ + xbt/graphxml.c \ + xbt/graphxml.dtd \ xbt/context_private.h xbt/context_win32.h xbt/context_win32.c\ \ surf/maxmin_private.h \ @@ -118,6 +122,7 @@ COMMON_SRC=\ xbt/module.c \ xbt/config.c \ xbt/cunit.c \ + xbt/graphxml_parse.c \ \ gras/gras.c \ \ @@ -193,6 +198,7 @@ TEST_UNITS= cunit_unit.c ex_unit.c \ config_unit.c BUILT_SOURCES=../include/surf/surfxml.h surf/surfxml.c \ + ../include/xbt/graphxml.h xbt/graphxml.c \ gras/DataDesc/ddt_parse.yy.c \ $(TEST_UNITS) simgrid_units_main.c @@ -201,7 +207,7 @@ testall_LDADD=libgras.la TESTS=testall EXTRA_DIST+=$(testall_SOURCES) - + if MAINTAINER_MODE cunit_unit.c: xbt/cunit.c @top_srcdir@/tools/sg_unit_extractor.pl $^ @@ -240,13 +246,21 @@ gras/DataDesc/ddt_parse.yy.c: gras/DataDesc/ddt_parse.yy.l if MAINTAINER_MODE surf/surfxml.c: surf/surfxml.l +# @LEX@ -Psurf_parse_ -t $^ | sed 's/]]//' > $@ @LEX@ -o$@ -Psurf_parse_ $^ +xbt/graphxml.c: xbt/graphxml.l +# @LEX@ -Pxbt_graph_parse_ -t $^ | sed 's/]]//' > $@ + @LEX@ -o$@ -Pxbt_graph_parse_ $^ if HAVE_FLEXML surf/surfxml.l: surf/surfxml.dtd - set -e; cd surf; flexml -b 1000000 -S -L surfxml.dtd + set -e; cd surf; flexml -b 1000000 -P surfxml -S -L surfxml.dtd ../include/surf/surfxml.h: surf/surfxml.dtd - cd ../include/surf; flexml -H -L ../../src/surf/surfxml.dtd + cd ../include/surf; flexml -P surfxml -H -L ../../src/surf/surfxml.dtd +xbt/graphxml.l: xbt/graphxml.dtd + set -e; cd xbt; flexml -b 1000000 -P grahxml -S -L graphxml.dtd +../include/xbt/graphxml.h: xbt/graphxml.dtd + cd ../include/xbt; flexml -P grahxml -H -L ../../src/xbt/graphxml.dtd else ../include/surf/surfxml.h surf/surfxml.l: surf/surfxml.dtd @@ -254,6 +268,11 @@ else @echo "ERROR: Please install it, or if you didn't modify this file, try this:" @echo "ERROR: touch src/include/surf/surfxml.h src/surf/surfxml.l" @exit 1 +../include/xbt/graphxml.h xbt/graphxml.l: xbt/graphxml.dtd + @echo "ERROR: src/xbt/graphxml.dtd was modified, but the flexml program was not detected" + @echo "ERROR: Please install it, or if you didn't modify this file, try this:" + @echo "ERROR: touch src/include/xbt/graphxml.h src/xbt/graphxml.l" + @exit 1 endif endif diff --git a/src/xbt/graphxml.c b/src/xbt/graphxml.c new file mode 100644 index 0000000000..4cbf01658f --- /dev/null +++ b/src/xbt/graphxml.c @@ -0,0 +1,3110 @@ +#line 2 "xbt/graphxml.c" + +#line 4 "xbt/graphxml.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 31 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include +#include +#include +#include + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#endif /* ! FLEXINT_H */ + +#ifdef __cplusplus + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN (yy_start) = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START (((yy_start) - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE xbt_graph_parse_restart(xbt_graph_parse_in ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#define YY_BUF_SIZE 16384 +#endif + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +extern int xbt_graph_parse_leng; + +extern FILE *xbt_graph_parse_in, *xbt_graph_parse_out; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires + * access to the local variable yy_act. Since yyless() is a macro, it would break + * existing scanners that call yyless() from OUTSIDE xbt_graph_parse_lex. + * One obvious solution it to make yy_act a global. I tried that, and saw + * a 5% performance hit in a non-xbt_graph_parse_lineno scanner, because yy_act is + * normally declared as a register variable-- so it is not worth it. + */ + #define YY_LESS_LINENO(n) \ + do { \ + int yyl;\ + for ( yyl = n; yyl < xbt_graph_parse_leng; ++yyl )\ + if ( xbt_graph_parse_text[yyl] == '\n' )\ + --xbt_graph_parse_lineno;\ + }while(0) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up xbt_graph_parse_text. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up xbt_graph_parse_text again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, (yytext_ptr) ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef unsigned int yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via xbt_graph_parse_restart()), so that the user can continue scanning by + * just pointing xbt_graph_parse_in at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) + +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] + +/* yy_hold_char holds the character lost when xbt_graph_parse_text is formed. */ +static char yy_hold_char; +static int yy_n_chars; /* number of characters read into yy_ch_buf */ +int xbt_graph_parse_leng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow xbt_graph_parse_wrap()'s to do buffer switches + * instead of setting up a fresh xbt_graph_parse_in. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void xbt_graph_parse_restart (FILE *input_file ); +void xbt_graph_parse__switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE xbt_graph_parse__create_buffer (FILE *file,int size ); +void xbt_graph_parse__delete_buffer (YY_BUFFER_STATE b ); +void xbt_graph_parse__flush_buffer (YY_BUFFER_STATE b ); +void xbt_graph_parse_push_buffer_state (YY_BUFFER_STATE new_buffer ); +void xbt_graph_parse_pop_buffer_state (void ); + +static void xbt_graph_parse_ensure_buffer_stack (void ); +static void xbt_graph_parse__load_buffer_state (void ); +static void xbt_graph_parse__init_buffer (YY_BUFFER_STATE b,FILE *file ); + +#define YY_FLUSH_BUFFER xbt_graph_parse__flush_buffer(YY_CURRENT_BUFFER ) + +YY_BUFFER_STATE xbt_graph_parse__scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE xbt_graph_parse__scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE xbt_graph_parse__scan_bytes (yyconst char *bytes,int len ); + +void *xbt_graph_parse_alloc (yy_size_t ); +void *xbt_graph_parse_realloc (void *,yy_size_t ); +void xbt_graph_parse_free (void * ); + +#define yy_new_buffer xbt_graph_parse__create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + xbt_graph_parse_ensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + xbt_graph_parse__create_buffer(xbt_graph_parse_in,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + xbt_graph_parse_ensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + xbt_graph_parse__create_buffer(xbt_graph_parse_in,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ + +#define xbt_graph_parse_wrap(n) 1 +#define YY_SKIP_YYWRAP + +typedef unsigned char YY_CHAR; + +FILE *xbt_graph_parse_in = (FILE *) 0, *xbt_graph_parse_out = (FILE *) 0; + +typedef int yy_state_type; + +extern int xbt_graph_parse_lineno; + +int xbt_graph_parse_lineno = 1; + +extern char *xbt_graph_parse_text; +#define yytext_ptr xbt_graph_parse_text + +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up xbt_graph_parse_text. + */ +#define YY_DO_BEFORE_ACTION \ + (yytext_ptr) = yy_bp; \ + xbt_graph_parse_leng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 79 +#define YY_END_OF_BUFFER 80 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[497] = + { 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 80, 78, 17, 10, 10, 17, 17, 58, 10, 58, + 5, 6, 5, 8, 9, 8, 74, 66, 67, 75, + 72, 75, 73, 77, 66, 67, 77, 78, 21, 10, + 21, 21, 21, 19, 25, 10, 25, 25, 78, 78, + 25, 33, 10, 33, 33, 33, 31, 33, 33, 37, + + 10, 37, 53, 10, 53, 53, 53, 51, 53, 53, + 53, 53, 53, 57, 10, 57, 75, 74, 10, 0, + 2, 2, 0, 4, 7, 69, 68, 0, 0, 0, + 0, 0, 0, 0, 20, 22, 0, 0, 0, 32, + 34, 34, 34, 0, 52, 54, 54, 54, 54, 54, + 54, 0, 0, 0, 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, 76, 0, 0, 0, + 0, 0, 34, 34, 0, 0, 54, 54, 54, 54, + 54, 0, 0, 0, 71, 0, 16, 1, 0, 0, + 64, 0, 0, 0, 61, 60, 0, 0, 0, 0, + + 24, 0, 0, 0, 34, 34, 0, 0, 36, 0, + 54, 54, 54, 54, 54, 0, 0, 56, 0, 0, + 0, 0, 65, 59, 0, 0, 0, 0, 38, 26, + 34, 0, 0, 0, 54, 54, 0, 0, 54, 54, + 0, 0, 0, 0, 0, 12, 0, 62, 63, 18, + 0, 38, 26, 0, 0, 0, 30, 29, 0, 54, + 0, 0, 0, 42, 41, 54, 54, 0, 0, 0, + 0, 0, 11, 18, 0, 0, 28, 27, 0, 35, + 54, 0, 40, 39, 0, 0, 0, 0, 0, 55, + 0, 0, 0, 0, 0, 23, 54, 0, 44, 43, + + 0, 46, 45, 0, 0, 0, 0, 54, 70, 0, + 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 12, 0, 12, 0, + 0, 48, 0, 47, 0, 0, 0, 0, 0, 0, + 0, 50, 49, 0, 0, 0, 0, 0, 0, 0, + + 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, + 0, 0, 14, 0, 15, 0 + + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 2, 4, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 5, 6, 7, 1, 1, 8, 9, 1, + 1, 1, 1, 1, 10, 11, 12, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 14, 15, 16, + 17, 18, 19, 1, 20, 21, 22, 23, 24, 21, + 14, 14, 14, 14, 14, 14, 25, 14, 26, 27, + 14, 14, 28, 29, 14, 14, 14, 14, 30, 14, + 31, 1, 32, 1, 14, 1, 33, 34, 35, 36, + + 37, 38, 39, 40, 41, 14, 14, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 14, 53, + 14, 14, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst flex_int32_t yy_meta[54] = + { 0, + 1, 2, 2, 2, 1, 1, 1, 1, 1, 3, + 3, 1, 4, 5, 1, 1, 1, 6, 1, 7, + 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, + 1, 1, 7, 7, 7, 7, 7, 7, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5 + } ; + +static yyconst flex_int16_t yy_base[527] = + { 0, + 0, 0, 0, 3, 6, 9, 24, 27, 11, 14, + 15, 17, 29, 38, 45, 52, 59, 61, 67, 70, + 93, 125, 73, 76, 143, 146, 149, 164, 167, 170, + 173, 188, 191, 194, 197, 212, 215, 218, 234, 0, + 286, 289, 292, 295, 311, 0, 363, 366, 368, 370, + 1424, 1425, 1425, 111, 114, 47, 62, 1425, 117, 159, + 1425, 1425, 1413, 1425, 1425, 1404, 1425, 1417, 1417, 368, + 1425, 1425, 1425, 1425, 1415, 1415, 1385, 372, 1425, 221, + 1398, 0, 183, 1425, 1425, 385, 380, 385, 375, 376, + 393, 1425, 423, 1397, 0, 207, 1425, 1381, 1380, 1425, + + 426, 404, 1425, 429, 1394, 0, 401, 1425, 1362, 1377, + 1376, 1363, 1374, 1425, 432, 432, 1401, 1373, 436, 34, + 1351, 1425, 1393, 1384, 1425, 1425, 1425, 37, 39, 1351, + 1350, 1348, 1380, 1349, 1425, 0, 1357, 1359, 1349, 1425, + 0, 1359, 1349, 1347, 1425, 0, 1367, 1355, 1345, 1336, + 1338, 1348, 1353, 1365, 1364, 1371, 137, 1337, 1425, 145, + 0, 1333, 1333, 1362, 1361, 1330, 1425, 1341, 439, 443, + 1266, 1268, 1257, 1254, 446, 450, 1247, 1248, 1241, 1225, + 1229, 456, 463, 1164, 1425, 1167, 1425, 1425, 17, 1142, + 1425, 1168, 1167, 1132, 1425, 1425, 1130, 1133, 467, 474, + + 1425, 480, 1141, 1140, 1134, 484, 500, 503, 1425, 506, + 1126, 1127, 512, 1133, 1129, 523, 528, 1425, 531, 1142, + 385, 534, 1425, 1425, 1148, 1147, 1117, 541, 552, 558, + 561, 564, 570, 580, 1109, 586, 589, 593, 1108, 1090, + 605, 1112, 378, 1108, 608, 1425, 1106, 1425, 1425, 611, + 616, 625, 628, 633, 637, 645, 1425, 1425, 655, 1084, + 659, 662, 675, 1425, 1425, 683, 686, 689, 1033, 282, + 143, 70, 1425, 692, 695, 702, 1425, 1425, 712, 1425, + 954, 715, 1425, 1425, 723, 729, 739, 742, 750, 1425, + 978, 161, 104, 136, 755, 1425, 951, 758, 1425, 1425, + + 768, 1425, 1425, 953, 776, 163, 444, 892, 1425, 779, + 191, 164, 782, 193, 185, 445, 438, 455, 785, 789, + 457, 479, 504, 188, 476, 801, 473, 501, 510, 41, + 532, 562, 809, 843, 827, 839, 808, 817, 576, 826, + 829, 834, 839, 780, 763, 724, 712, 851, 856, 859, + 863, 880, 888, 906, 938, 626, 587, 556, 520, 603, + 898, 637, 956, 664, 292, 974, 1006, 482, 511, 435, + 446, 365, 692, 530, 731, 285, 415, 471, 409, 901, + 301, 1425, 297, 1425, 557, 684, 651, 224, 104, 75, + 930, 1425, 1425, 553, 654, 620, 5, 711, 710, 751, + + 1425, 969, 783, 998, 1024, 1032, 1037, 586, 635, 1045, + 757, 831, 604, 691, 832, 846, 702, 791, 567, 782, + 881, 913, 807, 855, 788, 850, 860, 918, 917, 948, + 683, 877, 950, 985, 909, 912, 737, 946, 977, 979, + 967, 1011, 1014, 1026, 1027, 1034, 1035, 1038, 1040, 1041, + 1042, 1043, 1047, 1048, 806, 1056, 1050, 1052, 1061, 1066, + 729, 1055, 1077, 1082, 1078, 1079, 1053, 1057, 1080, 1081, + 1058, 1083, 1084, 1086, 1087, 1088, 1091, 1092, 1105, 1103, + 1095, 1100, 1123, 1116, 1140, 1129, 1121, 1146, 1149, 1425, + 1152, 1157, 1425, 1169, 1425, 1425, 1187, 1194, 1201, 1208, + + 1215, 1222, 1229, 1236, 1243, 1250, 1257, 1262, 1267, 1272, + 1279, 1282, 1285, 1288, 1295, 1299, 1305, 1311, 1317, 1324, + 1331, 1338, 1345, 1352, 1359, 1366 + } ; + +static yyconst flex_int16_t yy_def[527] = + { 0, + 497, 497, 498, 498, 498, 498, 499, 499, 500, 500, + 501, 501, 502, 502, 502, 502, 503, 503, 497, 497, + 504, 504, 505, 505, 505, 505, 497, 497, 505, 505, + 497, 497, 505, 505, 505, 505, 497, 497, 496, 39, + 506, 506, 497, 497, 496, 45, 507, 507, 502, 502, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 508, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 509, 496, 496, 509, 509, 496, + + 496, 496, 496, 496, 496, 510, 496, 496, 510, 510, + 510, 510, 510, 496, 496, 496, 496, 496, 496, 511, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 508, 512, 496, 496, 496, + 509, 509, 509, 513, 496, 510, 510, 510, 510, 510, + 510, 514, 496, 496, 515, 496, 515, 496, 496, 496, + 516, 496, 496, 496, 496, 496, 496, 496, 517, 517, + 496, 496, 509, 509, 518, 518, 510, 510, 510, 510, + 510, 519, 519, 496, 496, 515, 496, 496, 515, 496, + 496, 516, 496, 496, 496, 496, 496, 496, 496, 517, + + 496, 517, 496, 496, 509, 509, 496, 518, 496, 518, + 510, 510, 510, 510, 510, 496, 519, 496, 519, 496, + 515, 520, 496, 496, 496, 496, 496, 517, 496, 496, + 509, 496, 496, 518, 510, 510, 496, 496, 510, 510, + 519, 496, 515, 520, 520, 496, 520, 496, 496, 496, + 517, 496, 496, 496, 496, 496, 496, 496, 518, 510, + 496, 496, 496, 496, 496, 510, 510, 519, 496, 515, + 520, 520, 496, 496, 517, 496, 496, 496, 496, 496, + 510, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 515, 520, 520, 496, 496, 510, 496, 496, 496, + + 496, 496, 496, 496, 515, 520, 520, 510, 496, 515, + 520, 520, 510, 515, 515, 515, 520, 520, 496, 496, + 515, 515, 515, 520, 520, 496, 496, 496, 515, 515, + 515, 520, 520, 496, 496, 496, 496, 515, 515, 515, + 520, 520, 520, 496, 496, 496, 496, 515, 515, 515, + 520, 520, 520, 521, 522, 496, 496, 496, 496, 515, + 515, 515, 520, 523, 524, 521, 522, 496, 496, 496, + 496, 515, 515, 515, 523, 520, 525, 524, 526, 520, + 496, 496, 496, 496, 515, 515, 515, 525, 496, 526, + 520, 496, 496, 515, 515, 515, 496, 515, 515, 515, + + 496, 515, 515, 515, 515, 515, 515, 515, 515, 515, + 515, 515, 515, 515, 515, 515, 515, 515, 515, 515, + 515, 515, 515, 515, 515, 515, 515, 515, 515, 515, + 515, 515, 515, 515, 515, 515, 515, 515, 515, 515, + 515, 515, 515, 515, 515, 515, 515, 515, 515, 515, + 515, 515, 515, 515, 515, 515, 515, 515, 515, 515, + 515, 515, 515, 515, 515, 515, 515, 515, 515, 515, + 515, 515, 515, 515, 515, 515, 515, 515, 515, 515, + 515, 515, 515, 515, 515, 515, 515, 515, 515, 496, + 515, 515, 496, 515, 496, 0, 496, 496, 496, 496, + + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496 + } ; + +static yyconst flex_int16_t yy_nxt[1479] = + { 0, + 496, 54, 55, 54, 54, 55, 54, 54, 55, 54, + 54, 55, 54, 62, 496, 56, 62, 65, 56, 65, + 63, 57, 401, 63, 57, 59, 55, 59, 59, 55, + 59, 68, 69, 66, 187, 66, 70, 71, 221, 60, + 68, 69, 60, 156, 72, 70, 71, 68, 69, 160, + 73, 120, 70, 72, 68, 69, 157, 73, 187, 70, + 72, 75, 76, 75, 76, 121, 120, 72, 55, 55, + 55, 55, 55, 55, 86, 55, 86, 86, 55, 86, + 122, 162, 78, 389, 163, 78, 339, 246, 87, 161, + 77, 87, 77, 79, 80, 55, 80, 79, 79, 79, + + 79, 79, 79, 79, 81, 79, 294, 79, 83, 79, + 84, 79, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 246, 397, 79, 79, 79, 80, 55, 80, 79, + 79, 79, 79, 79, 79, 79, 81, 79, 306, 79, + 83, 79, 84, 79, 86, 55, 86, 86, 55, 86, + 55, 55, 55, 246, 187, 79, 79, 160, 88, 191, + 246, 88, 189, 123, 89, 55, 55, 55, 86, 55, + 86, 86, 55, 86, 55, 55, 55, 122, 187, 89, + 246, 246, 87, 307, 305, 87, 293, 123, 90, 55, + 55, 55, 86, 55, 86, 86, 55, 86, 86, 55, + + 86, 122, 187, 90, 318, 246, 88, 311, 246, 88, + 187, 123, 91, 86, 55, 86, 55, 55, 55, 55, + 55, 55, 119, 119, 119, 122, 317, 91, 321, 389, + 89, 332, 322, 89, 92, 93, 55, 93, 92, 92, + 92, 92, 92, 92, 92, 94, 92, 95, 92, 96, + 92, 97, 92, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 92, 92, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 98, 95, 99, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 101, 55, 101, + 101, 55, 101, 55, 55, 55, 55, 55, 55, 187, + + 376, 102, 246, 247, 102, 393, 392, 90, 292, 379, + 90, 103, 104, 55, 104, 103, 103, 103, 103, 103, + 103, 103, 105, 103, 106, 103, 107, 103, 108, 103, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 103, 103, 106, 106, 106, 106, 106, 106, 106, + 106, 109, 110, 106, 111, 106, 106, 106, 106, 112, + 113, 106, 106, 106, 115, 55, 115, 115, 55, 115, + 68, 69, 68, 69, 128, 70, 123, 70, 116, 123, + 123, 116, 187, 117, 123, 117, 119, 119, 119, 123, + 122, 137, 385, 122, 122, 187, 137, 123, 122, 118, + + 129, 118, 187, 122, 137, 123, 130, 270, 123, 131, + 134, 122, 138, 243, 132, 144, 138, 389, 139, 122, + 389, 138, 122, 139, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 123, 119, 119, 119, + 199, 199, 199, 152, 199, 199, 199, 207, 207, 207, + 122, 207, 207, 207, 384, 246, 201, 216, 216, 216, + 201, 246, 187, 209, 216, 216, 216, 209, 199, 199, + 199, 383, 246, 218, 187, 199, 199, 199, 324, 376, + 218, 199, 199, 199, 201, 232, 232, 232, 379, 323, + 202, 201, 312, 246, 210, 329, 187, 201, 219, 325, + + 233, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 334, 330, 228, 237, 237, 237, 382, 209, 381, 333, + 209, 187, 335, 209, 216, 216, 216, 187, 238, 216, + 216, 216, 216, 216, 216, 245, 245, 245, 336, 331, + 218, 234, 199, 199, 199, 218, 338, 187, 218, 187, + 337, 246, 247, 252, 252, 252, 371, 387, 201, 253, + 253, 253, 254, 254, 254, 232, 232, 232, 340, 241, + 187, 256, 256, 256, 187, 257, 398, 255, 258, 246, + 233, 207, 207, 207, 187, 394, 251, 261, 261, 261, + 237, 237, 237, 187, 263, 263, 263, 209, 264, 425, + + 341, 265, 262, 187, 370, 238, 216, 216, 216, 245, + 245, 245, 274, 274, 274, 349, 259, 199, 199, 199, + 187, 187, 218, 369, 413, 246, 252, 252, 252, 253, + 253, 253, 372, 201, 254, 254, 254, 187, 276, 276, + 276, 268, 277, 400, 271, 278, 256, 256, 256, 255, + 257, 419, 187, 258, 187, 275, 279, 279, 279, 272, + 261, 261, 261, 282, 282, 282, 374, 283, 187, 376, + 284, 187, 280, 414, 368, 262, 263, 263, 263, 396, + 264, 377, 399, 265, 285, 285, 285, 287, 287, 287, + 289, 289, 289, 274, 274, 274, 295, 295, 295, 286, + + 187, 187, 288, 276, 276, 276, 290, 277, 187, 187, + 278, 395, 296, 279, 279, 279, 282, 282, 282, 187, + 283, 386, 437, 284, 285, 285, 285, 187, 187, 280, + 298, 298, 298, 403, 299, 402, 376, 300, 420, 286, + 287, 287, 287, 301, 301, 301, 187, 302, 377, 423, + 303, 289, 289, 289, 187, 288, 295, 295, 295, 298, + 298, 298, 359, 299, 467, 358, 300, 290, 187, 301, + 301, 301, 296, 302, 187, 404, 303, 310, 310, 310, + 310, 310, 310, 319, 319, 319, 319, 319, 319, 443, + 326, 326, 326, 187, 327, 417, 187, 328, 320, 187, + + 187, 320, 326, 326, 326, 187, 327, 406, 187, 328, + 342, 342, 342, 357, 426, 314, 461, 315, 348, 348, + 348, 356, 316, 187, 187, 343, 246, 350, 350, 350, + 351, 351, 351, 431, 187, 342, 342, 342, 424, 429, + 353, 353, 353, 187, 354, 352, 246, 355, 187, 187, + 343, 246, 348, 348, 348, 347, 246, 361, 361, 361, + 350, 350, 350, 187, 351, 351, 351, 187, 187, 418, + 421, 346, 187, 187, 345, 344, 187, 187, 360, 352, + 246, 363, 363, 363, 422, 364, 362, 430, 365, 353, + 353, 353, 433, 354, 187, 432, 355, 246, 187, 361, + + 361, 361, 391, 391, 391, 246, 244, 244, 244, 244, + 244, 244, 244, 244, 244, 187, 438, 244, 246, 247, + 244, 244, 244, 246, 244, 373, 187, 313, 427, 187, + 187, 391, 391, 391, 187, 187, 244, 244, 244, 244, + 244, 244, 244, 244, 244, 244, 244, 246, 441, 244, + 434, 442, 244, 244, 244, 246, 244, 363, 363, 363, + 428, 364, 435, 187, 365, 187, 271, 187, 244, 244, + 405, 405, 405, 246, 244, 244, 244, 244, 244, 380, + 244, 244, 244, 309, 187, 244, 187, 308, 244, 244, + 244, 246, 244, 436, 187, 439, 187, 304, 444, 407, + + 407, 407, 187, 297, 244, 244, 244, 244, 244, 244, + 244, 244, 244, 244, 380, 187, 445, 244, 446, 447, + 244, 244, 244, 246, 244, 405, 405, 405, 187, 408, + 440, 187, 409, 410, 410, 410, 244, 244, 407, 407, + 407, 187, 411, 187, 187, 412, 410, 410, 410, 187, + 415, 187, 187, 416, 187, 187, 449, 187, 187, 187, + 187, 291, 187, 448, 187, 187, 462, 187, 450, 187, + 187, 465, 187, 187, 187, 187, 466, 453, 187, 451, + 454, 455, 456, 187, 457, 458, 452, 469, 459, 460, + 468, 463, 470, 464, 187, 187, 187, 187, 187, 187, + + 187, 187, 473, 187, 187, 187, 474, 477, 187, 187, + 485, 485, 187, 471, 472, 475, 476, 187, 281, 479, + 187, 480, 187, 273, 488, 246, 483, 484, 488, 491, + 486, 269, 478, 187, 491, 487, 481, 482, 187, 267, + 187, 489, 489, 489, 266, 260, 187, 492, 492, 492, + 489, 489, 489, 494, 494, 494, 250, 490, 492, 492, + 492, 249, 248, 493, 242, 240, 490, 239, 236, 495, + 494, 494, 494, 235, 493, 231, 230, 229, 227, 226, + 225, 224, 223, 222, 187, 220, 495, 52, 52, 52, + 52, 52, 52, 52, 53, 53, 53, 53, 53, 53, + + 53, 58, 58, 58, 58, 58, 58, 58, 61, 61, + 61, 61, 61, 61, 61, 64, 64, 64, 64, 64, + 64, 64, 67, 67, 67, 67, 67, 67, 67, 74, + 74, 74, 74, 74, 74, 74, 82, 82, 82, 82, + 82, 82, 82, 85, 85, 85, 85, 85, 85, 85, + 100, 100, 100, 100, 100, 100, 100, 114, 114, 114, + 114, 114, 114, 114, 136, 136, 136, 215, 136, 141, + 141, 141, 214, 141, 146, 146, 146, 213, 146, 155, + 155, 155, 155, 155, 212, 155, 169, 211, 169, 175, + 206, 175, 182, 205, 182, 186, 186, 186, 186, 186, + + 186, 186, 192, 204, 203, 192, 200, 200, 200, 200, + 200, 200, 208, 208, 208, 208, 208, 208, 217, 217, + 217, 217, 217, 217, 244, 244, 244, 244, 244, 244, + 244, 366, 366, 366, 366, 366, 366, 366, 367, 367, + 367, 367, 367, 367, 367, 375, 375, 375, 375, 375, + 375, 375, 378, 378, 378, 378, 378, 378, 378, 388, + 388, 388, 388, 388, 388, 388, 390, 390, 390, 390, + 390, 390, 390, 198, 197, 196, 195, 194, 193, 190, + 188, 187, 185, 184, 183, 181, 180, 179, 178, 177, + 176, 174, 173, 172, 171, 170, 168, 167, 166, 165, + + 164, 159, 156, 158, 154, 153, 151, 150, 149, 148, + 147, 145, 143, 142, 140, 135, 133, 127, 126, 127, + 126, 125, 124, 496, 51, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496 + } ; + +static yyconst flex_int16_t yy_chk[1479] = + { 0, + 0, 3, 3, 3, 4, 4, 4, 5, 5, 5, + 6, 6, 6, 9, 0, 3, 10, 11, 4, 12, + 9, 5, 397, 10, 6, 7, 7, 7, 8, 8, + 8, 13, 13, 11, 189, 12, 13, 13, 189, 7, + 14, 14, 8, 120, 13, 14, 14, 15, 15, 128, + 15, 56, 15, 14, 16, 16, 120, 16, 330, 16, + 15, 17, 17, 18, 18, 56, 57, 16, 19, 19, + 19, 20, 20, 20, 23, 23, 23, 24, 24, 24, + 57, 129, 19, 390, 129, 20, 330, 272, 23, 128, + 17, 24, 18, 21, 21, 21, 21, 21, 21, 21, + + 21, 21, 21, 21, 21, 21, 272, 21, 21, 21, + 21, 21, 54, 54, 54, 55, 55, 55, 59, 59, + 59, 293, 389, 21, 21, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 293, 22, + 22, 22, 22, 22, 25, 25, 25, 26, 26, 26, + 27, 27, 27, 294, 157, 22, 22, 160, 25, 160, + 271, 26, 157, 60, 27, 28, 28, 28, 29, 29, + 29, 30, 30, 30, 31, 31, 31, 60, 292, 28, + 306, 312, 29, 294, 292, 30, 271, 83, 31, 32, + 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, + + 35, 83, 315, 32, 312, 324, 33, 306, 311, 34, + 314, 96, 35, 36, 36, 36, 37, 37, 37, 38, + 38, 38, 80, 80, 80, 96, 311, 36, 314, 388, + 37, 324, 315, 38, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 41, 41, 41, + 42, 42, 42, 43, 43, 43, 44, 44, 44, 270, + + 365, 41, 376, 376, 42, 383, 381, 43, 270, 365, + 44, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 47, 47, 47, 48, 48, 48, + 49, 49, 50, 50, 70, 49, 78, 50, 47, 89, + 90, 48, 372, 49, 87, 50, 86, 86, 86, 88, + 78, 87, 372, 89, 90, 243, 88, 91, 87, 49, + + 70, 50, 221, 88, 91, 107, 70, 243, 102, 70, + 78, 91, 90, 221, 70, 102, 87, 379, 89, 107, + 377, 88, 102, 87, 93, 93, 93, 101, 101, 101, + 104, 104, 104, 115, 115, 115, 116, 119, 119, 119, + 169, 169, 169, 116, 170, 170, 170, 175, 175, 175, + 116, 176, 176, 176, 371, 317, 169, 182, 182, 182, + 170, 307, 316, 175, 183, 183, 183, 176, 199, 199, + 199, 370, 318, 182, 321, 200, 200, 200, 317, 378, + 183, 202, 202, 202, 199, 206, 206, 206, 378, 316, + 170, 200, 307, 325, 176, 321, 322, 202, 183, 318, + + 206, 207, 207, 207, 208, 208, 208, 210, 210, 210, + 327, 322, 202, 213, 213, 213, 369, 207, 368, 325, + 208, 323, 327, 210, 216, 216, 216, 329, 213, 217, + 217, 217, 219, 219, 219, 222, 222, 222, 328, 323, + 216, 210, 228, 228, 228, 217, 329, 374, 219, 331, + 328, 222, 222, 229, 229, 229, 359, 374, 228, 230, + 230, 230, 231, 231, 231, 232, 232, 232, 331, 219, + 394, 233, 233, 233, 385, 233, 394, 231, 233, 332, + 232, 234, 234, 234, 419, 385, 228, 236, 236, 236, + 237, 237, 237, 339, 238, 238, 238, 234, 238, 419, + + 332, 238, 236, 408, 358, 237, 241, 241, 241, 245, + 245, 245, 250, 250, 250, 339, 234, 251, 251, 251, + 360, 413, 241, 357, 408, 245, 252, 252, 252, 253, + 253, 253, 360, 251, 254, 254, 254, 396, 255, 255, + 255, 241, 255, 396, 245, 255, 256, 256, 256, 254, + 256, 413, 409, 256, 362, 251, 259, 259, 259, 245, + 261, 261, 261, 262, 262, 262, 362, 262, 387, 364, + 262, 395, 259, 409, 356, 261, 263, 263, 263, 387, + 263, 364, 395, 263, 266, 266, 266, 267, 267, 267, + 268, 268, 268, 274, 274, 274, 275, 275, 275, 266, + + 431, 386, 267, 276, 276, 276, 268, 276, 414, 373, + 276, 386, 275, 279, 279, 279, 282, 282, 282, 417, + 282, 373, 431, 282, 285, 285, 285, 399, 398, 279, + 286, 286, 286, 399, 286, 398, 375, 286, 414, 285, + 287, 287, 287, 288, 288, 288, 461, 288, 375, 417, + 288, 289, 289, 289, 437, 287, 295, 295, 295, 298, + 298, 298, 347, 298, 461, 346, 298, 289, 400, 301, + 301, 301, 295, 301, 411, 400, 301, 305, 305, 305, + 310, 310, 310, 313, 313, 313, 319, 319, 319, 437, + 320, 320, 320, 305, 320, 411, 310, 320, 313, 420, + + 403, 319, 326, 326, 326, 425, 326, 403, 418, 326, + 333, 333, 333, 345, 420, 310, 455, 310, 338, 338, + 338, 344, 310, 455, 423, 333, 333, 340, 340, 340, + 341, 341, 341, 425, 338, 342, 342, 342, 418, 423, + 343, 343, 343, 340, 343, 341, 341, 343, 412, 415, + 342, 342, 348, 348, 348, 337, 343, 349, 349, 349, + 350, 350, 350, 416, 351, 351, 351, 426, 348, 412, + 415, 336, 424, 349, 335, 334, 350, 427, 348, 351, + 351, 352, 352, 352, 416, 352, 350, 424, 352, 353, + 353, 353, 427, 353, 432, 426, 353, 352, 421, 361, + + 361, 361, 380, 380, 380, 353, 354, 354, 354, 354, + 354, 354, 354, 354, 354, 361, 432, 354, 380, 380, + 354, 354, 354, 354, 354, 361, 435, 308, 421, 436, + 422, 391, 391, 391, 429, 428, 354, 354, 355, 355, + 355, 355, 355, 355, 355, 355, 355, 391, 435, 355, + 428, 436, 355, 355, 355, 355, 355, 363, 363, 363, + 422, 363, 429, 438, 363, 430, 391, 433, 355, 355, + 402, 402, 402, 363, 366, 366, 366, 366, 366, 366, + 366, 366, 366, 304, 441, 366, 402, 297, 366, 366, + 366, 366, 366, 430, 439, 433, 440, 291, 438, 404, + + 404, 404, 434, 281, 366, 366, 367, 367, 367, 367, + 367, 367, 367, 367, 367, 404, 439, 367, 440, 441, + 367, 367, 367, 367, 367, 405, 405, 405, 442, 405, + 434, 443, 405, 406, 406, 406, 367, 367, 407, 407, + 407, 405, 407, 444, 445, 407, 410, 410, 410, 406, + 410, 446, 447, 410, 407, 448, 443, 449, 450, 451, + 452, 269, 410, 442, 453, 454, 456, 457, 444, 458, + 467, 459, 462, 456, 468, 471, 460, 447, 459, 445, + 448, 449, 450, 460, 451, 452, 446, 463, 453, 454, + 462, 457, 464, 458, 463, 465, 466, 469, 470, 464, + + 472, 473, 467, 474, 475, 476, 468, 471, 477, 478, + 479, 480, 481, 465, 466, 469, 470, 482, 260, 473, + 480, 474, 479, 247, 484, 244, 477, 478, 483, 487, + 481, 242, 472, 484, 486, 482, 475, 476, 487, 240, + 483, 485, 485, 485, 239, 235, 486, 488, 488, 488, + 489, 489, 489, 491, 491, 491, 227, 485, 492, 492, + 492, 226, 225, 488, 220, 215, 489, 214, 212, 491, + 494, 494, 494, 211, 492, 205, 204, 203, 198, 197, + 194, 193, 192, 190, 186, 184, 494, 497, 497, 497, + 497, 497, 497, 497, 498, 498, 498, 498, 498, 498, + + 498, 499, 499, 499, 499, 499, 499, 499, 500, 500, + 500, 500, 500, 500, 500, 501, 501, 501, 501, 501, + 501, 501, 502, 502, 502, 502, 502, 502, 502, 503, + 503, 503, 503, 503, 503, 503, 504, 504, 504, 504, + 504, 504, 504, 505, 505, 505, 505, 505, 505, 505, + 506, 506, 506, 506, 506, 506, 506, 507, 507, 507, + 507, 507, 507, 507, 508, 508, 508, 181, 508, 509, + 509, 509, 180, 509, 510, 510, 510, 179, 510, 511, + 511, 511, 511, 511, 178, 511, 512, 177, 512, 513, + 174, 513, 514, 173, 514, 515, 515, 515, 515, 515, + + 515, 515, 516, 172, 171, 516, 517, 517, 517, 517, + 517, 517, 518, 518, 518, 518, 518, 518, 519, 519, + 519, 519, 519, 519, 520, 520, 520, 520, 520, 520, + 520, 521, 521, 521, 521, 521, 521, 521, 522, 522, + 522, 522, 522, 522, 522, 523, 523, 523, 523, 523, + 523, 523, 524, 524, 524, 524, 524, 524, 524, 525, + 525, 525, 525, 525, 525, 525, 526, 526, 526, 526, + 526, 526, 526, 168, 166, 165, 164, 163, 162, 158, + 156, 155, 154, 153, 152, 151, 150, 149, 148, 147, + 144, 143, 142, 139, 138, 137, 134, 133, 132, 131, + + 130, 124, 123, 121, 118, 117, 113, 112, 111, 110, + 109, 105, 99, 98, 94, 81, 77, 76, 75, 69, + 68, 66, 63, 51, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496 + } ; + +/* Table of booleans, true if rule could match eol. */ +static yyconst flex_int32_t yy_rule_can_match_eol[80] = + { 0, +0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, + 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, + }; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +extern int xbt_graph_parse__flex_debug; +int xbt_graph_parse__flex_debug = 0; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *xbt_graph_parse_text; +#line 1 "xbt/graphxml.l" +/* Validating XML processor for graphxml.dtd. + * Generated 2006/03/20 16:15:21. + * + * This program was generated with the FleXML XML processor generator. + * FleXML is Copyright © 1999-2005 Kristoffer Rose. All rights reserved. + * (Id: flexml.pl,v 1.45 2006/03/03 19:25:46 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 © 1999-2005 Kristoffer Rose. + * 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. + * + */ +#line 48 "xbt/graphxml.l" + +/* Version strings. */ +const char rcs_grahxml_flexml_skeleton[] = + "$" "Id: skel,v 1.26 2005/02/23 22:22:20 wdowling Exp $"; +const char rcs_grahxml_flexml[] = + "$" "Id: flexml.pl,v 1.45 2006/03/03 19:25:46 wdowling Exp $"; + +/* ANSI headers. */ +#include +#include +#include +#include +#include +#include + +/* Generated definitions. */ +#define FLEXML_yylineno +#define FLEXML_BUFFERSTACKSIZE 1000000 + +/* XML processor api. */ +/* FleXML-provided data. */ +const char* pcdata; +AT_edge_target A_edge_target; +AT_node_name A_node_name; +AT_node_label A_node_label; +AT_edge_label A_edge_label; +AT_edge_source A_edge_source; +AT_edge_isDirected A_edge_isDirected; +AT_edge_name A_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*, ...); +const char * grahxml_parse_err_msg(void); + +/* Cleanup */ +static void cleanup(void); +#define CLEANUP cleanup() + +/* Text buffer stack handling. */ +char bufferstack[FLEXML_BUFFERSTACKSIZE]; +static char* limit = bufferstack + FLEXML_BUFFERSTACKSIZE; +typedef struct BufferLast_s { + struct BufferLast_s *old; char* saved; char new1[1]; +} BufferLast; +#ifdef FLEXML_HasMixed +static BufferLast* last = (BufferLast*)0; +#endif +static char* next = bufferstack; + +#define BUFFERSET(P) (P = next) +#define BUFFERPUTC(C) (assert(nextold = last; + l->saved = p; + next = l->new1; + 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. */ +#define YY_NO_INPUT 1 +/* Flex user-requested options. */ +/* XML character classes (currently restricted to ASCII). */ +/* "Common syntactic structures." */ +/* "Names and Tokens." */ +/* Miscellaneous. */ +/* 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 + */ + + + + + +#line 210 "xbt/graphxml.l" +/* State names. */ +const char* *grahxml_statenames=NULL; +#line 1146 "xbt/graphxml.c" + +#define INITIAL 0 +#define PROLOG 1 +#define DOCTYPE 2 +#define EPILOG 3 +#define INCOMMENT 4 +#define INPI 5 +#define VALUE1 6 +#define VALUE2 7 +#define CDATA 8 +#define ROOT_graph 9 +#define AL_graph 10 +#define S_graph 11 +#define S_graph_1 12 +#define S_graph_2 13 +#define S_graph_3 14 +#define S_graph_4 15 +#define S_graph_5 16 +#define E_graph 17 +#define ROOT_node 18 +#define AL_node 19 +#define E_node 20 +#define ROOT_edge 21 +#define AL_edge 22 +#define E_edge 23 +#define IMPOSSIBLE 24 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int xbt_graph_parse_wrap (void ); +#else +extern int xbt_graph_parse_wrap (void ); +#endif +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (void ); +#else +static int input (void ); +#endif + +#endif + + static int yy_start_stack_ptr = 0; + static int yy_start_stack_depth = 0; + static int *yy_start_stack = 0; + + static void yy_push_state (int new_state ); + + static void yy_pop_state (void ); + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( xbt_graph_parse_text, xbt_graph_parse_leng, 1, xbt_graph_parse_out ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( xbt_graph_parse_in )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( xbt_graph_parse_in ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, xbt_graph_parse_in))==0 && ferror(xbt_graph_parse_in)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(xbt_graph_parse_in); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int xbt_graph_parse_lex (void); + +#define YY_DECL int xbt_graph_parse_lex (void) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after xbt_graph_parse_text and xbt_graph_parse_leng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 214 "xbt/graphxml.l" + + + /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ + SET(PROLOG); + /* FleXML_init */ + next = bufferstack; + if(!grahxml_statenames) {grahxml_statenames= (const char **)calloc(IMPOSSIBLE,sizeof(char*)); + grahxml_statenames[PROLOG] = NULL; + grahxml_statenames[DOCTYPE] = NULL; + grahxml_statenames[EPILOG] = NULL; + grahxml_statenames[INCOMMENT] = NULL; + grahxml_statenames[INPI] = NULL; + grahxml_statenames[VALUE1] = NULL; + grahxml_statenames[VALUE2] = NULL; + grahxml_statenames[CDATA] = NULL; + grahxml_statenames[ROOT_graph] = NULL; + grahxml_statenames[AL_graph] = NULL; + grahxml_statenames[S_graph] = "graph"; + grahxml_statenames[S_graph_1] = "graph"; + grahxml_statenames[S_graph_2] = "graph"; + grahxml_statenames[S_graph_3] = "graph"; + grahxml_statenames[S_graph_4] = "graph"; + grahxml_statenames[S_graph_5] = "graph"; + grahxml_statenames[E_graph] = "graph"; + grahxml_statenames[ROOT_node] = NULL; + grahxml_statenames[AL_node] = NULL; + grahxml_statenames[E_node] = "node"; + grahxml_statenames[ROOT_edge] = NULL; + grahxml_statenames[AL_edge] = NULL; + grahxml_statenames[E_edge] = "edge"; + } + + /* COMMENTS and PIs: handled uniformly for efficiency. */ + +#line 1362 "xbt/graphxml.c" + + if ( (yy_init) ) + { + (yy_init) = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ + + if ( ! xbt_graph_parse_in ) + xbt_graph_parse_in = stdin; + + if ( ! xbt_graph_parse_out ) + xbt_graph_parse_out = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + xbt_graph_parse_ensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + xbt_graph_parse__create_buffer(xbt_graph_parse_in,YY_BUF_SIZE ); + } + + xbt_graph_parse__load_buffer_state( ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); + + /* Support of xbt_graph_parse_text. */ + *yy_cp = (yy_hold_char); + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = (yy_start); +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 497 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 1425 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) + { + int yyl; + for ( yyl = 0; yyl < xbt_graph_parse_leng; ++yyl ) + if ( xbt_graph_parse_text[yyl] == '\n' ) + + xbt_graph_parse_lineno++; +; + } + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 249 "xbt/graphxml.l" +ENTER(INCOMMENT); + YY_BREAK +case 2: +YY_RULE_SETUP +#line 250 "xbt/graphxml.l" +ENTER(INPI); + YY_BREAK + + +case 3: +YY_RULE_SETUP +#line 253 "xbt/graphxml.l" +LEAVE; + YY_BREAK +case 4: +#line 255 "xbt/graphxml.l" +case 5: +#line 256 "xbt/graphxml.l" +case 6: +/* rule 6 can match eol */ +YY_RULE_SETUP +#line 256 "xbt/graphxml.l" +SKIP; + YY_BREAK +case YY_STATE_EOF(INCOMMENT): +#line 257 "xbt/graphxml.l" +FAIL("EOF in comment."); + YY_BREAK + + +case 7: +YY_RULE_SETUP +#line 260 "xbt/graphxml.l" +LEAVE; + YY_BREAK +case 8: +#line 262 "xbt/graphxml.l" +case 9: +/* rule 9 can match eol */ +YY_RULE_SETUP +#line 262 "xbt/graphxml.l" +SKIP; + YY_BREAK +case YY_STATE_EOF(INPI): +#line 263 "xbt/graphxml.l" +FAIL("EOF in PI (processing instruction)."); + YY_BREAK + +/* SPACES: skipped uniformly */ +case 10: +/* rule 10 can match eol */ +YY_RULE_SETUP +#line 268 "xbt/graphxml.l" +SKIP; + YY_BREAK +/* PROLOG: determine root element and process it. */ + +case 11: +/* rule 11 can match eol */ +YY_RULE_SETUP +#line 273 "xbt/graphxml.l" +SET(DOCTYPE); + YY_BREAK +case 12: +/* rule 12 can match eol */ +YY_RULE_SETUP +#line 274 "xbt/graphxml.l" +FAIL("Bad declaration %s.",xbt_graph_parse_text); + YY_BREAK + + +case 13: +/* rule 13 can match eol */ +YY_RULE_SETUP +#line 278 "xbt/graphxml.l" +SET(ROOT_edge); + YY_BREAK +case 14: +/* rule 14 can match eol */ +YY_RULE_SETUP +#line 279 "xbt/graphxml.l" +SET(ROOT_node); + YY_BREAK +case 15: +/* rule 15 can match eol */ +YY_RULE_SETUP +#line 280 "xbt/graphxml.l" +SET(ROOT_graph); + YY_BREAK +case 16: +/* rule 16 can match eol */ +YY_RULE_SETUP +#line 281 "xbt/graphxml.l" +FAIL("Bad declaration %s.",xbt_graph_parse_text); + YY_BREAK +case 17: +YY_RULE_SETUP +#line 282 "xbt/graphxml.l" +FAIL("Unexpected character `%c' in prolog.", xbt_graph_parse_text[0]); + YY_BREAK +case YY_STATE_EOF(PROLOG): +case YY_STATE_EOF(DOCTYPE): +#line 283 "xbt/graphxml.l" +FAIL("EOF in prolog."); + YY_BREAK + +/* RULES DERIVED FROM DTD. */ +/* */ +case 18: +/* rule 18 can match eol */ +YY_RULE_SETUP +#line 290 "xbt/graphxml.l" +{ + ENTER(AL_graph); + } + YY_BREAK + +case 19: +YY_RULE_SETUP +#line 295 "xbt/graphxml.l" +{ + LEAVE; STag_graph();pcdata = NULL; ENTER(S_graph); + } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 298 "xbt/graphxml.l" +{ + LEAVE; STag_graph(); pcdata = NULL; ETag_graph(); + switch (YY_START) { + case ROOT_graph: SET(EPILOG); break; + } + } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 304 "xbt/graphxml.l" +FAIL("Unexpected character `%c' in attribute list of graph element.", xbt_graph_parse_text[0]); + YY_BREAK +case 22: +YY_RULE_SETUP +#line 305 "xbt/graphxml.l" +FAIL("Bad attribute `%s' in `graph' element start tag.",xbt_graph_parse_text); + YY_BREAK +case YY_STATE_EOF(AL_graph): +#line 306 "xbt/graphxml.l" +FAIL("EOF in attribute list of `graph' element."); + YY_BREAK + + +case 23: +/* rule 23 can match eol */ +YY_RULE_SETUP +#line 310 "xbt/graphxml.l" +{ + LEAVE; + ETag_graph(); + switch (YY_START) { + case ROOT_graph: SET(EPILOG); break; + } + } + YY_BREAK +case 24: +/* rule 24 can match eol */ +YY_RULE_SETUP +#line 317 "xbt/graphxml.l" +FAIL("Unexpected end-tag `%s': `' expected.",xbt_graph_parse_text); + YY_BREAK +case 25: +YY_RULE_SETUP +#line 318 "xbt/graphxml.l" +FAIL("Unexpected character `%c': `' expected.",xbt_graph_parse_text[0]); + YY_BREAK +case YY_STATE_EOF(S_graph_1): +case YY_STATE_EOF(E_graph): +case YY_STATE_EOF(S_graph_3): +case YY_STATE_EOF(S_graph_5): +case YY_STATE_EOF(S_graph): +#line 319 "xbt/graphxml.l" +FAIL("Premature EOF: `' expected."); + YY_BREAK + +/* label CDATA "" + * name CDATA #REQUIRED + * > */ +case 26: +/* rule 26 can match eol */ +YY_RULE_SETUP +#line 326 "xbt/graphxml.l" +{ + A_node_label = NULL; + A_node_name = NULL; + ENTER(AL_node); + } + YY_BREAK + +case 27: +/* rule 27 can match eol */ +YY_RULE_SETUP +#line 333 "xbt/graphxml.l" +ENTER(VALUE1); BUFFERSET(A_node_label); + YY_BREAK +case 28: +/* rule 28 can match eol */ +YY_RULE_SETUP +#line 334 "xbt/graphxml.l" +ENTER(VALUE2); BUFFERSET(A_node_label); + YY_BREAK +case 29: +/* rule 29 can match eol */ +YY_RULE_SETUP +#line 336 "xbt/graphxml.l" +ENTER(VALUE1); BUFFERSET(A_node_name); + YY_BREAK +case 30: +/* rule 30 can match eol */ +YY_RULE_SETUP +#line 337 "xbt/graphxml.l" +ENTER(VALUE2); BUFFERSET(A_node_name); + YY_BREAK +case 31: +YY_RULE_SETUP +#line 339 "xbt/graphxml.l" +{ + if (!A_node_name) FAIL("Required attribute `name' not set for `node' element."); + LEAVE; STag_node();pcdata = NULL; ENTER(E_node); + } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 343 "xbt/graphxml.l" +{ + if (!A_node_name) FAIL("Required attribute `name' not set for `node' element."); + LEAVE; STag_node(); pcdata = NULL; ETag_node(); + switch (YY_START) { + case S_graph_2: case S_graph_3: case S_graph: SET(S_graph_3); break; + case ROOT_node: SET(EPILOG); break; + } + } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 351 "xbt/graphxml.l" +FAIL("Unexpected character `%c' in attribute list of node element.", xbt_graph_parse_text[0]); + YY_BREAK +case 34: +YY_RULE_SETUP +#line 352 "xbt/graphxml.l" +FAIL("Bad attribute `%s' in `node' element start tag.",xbt_graph_parse_text); + YY_BREAK +case YY_STATE_EOF(AL_node): +#line 353 "xbt/graphxml.l" +FAIL("EOF in attribute list of `node' element."); + YY_BREAK + + +case 35: +/* rule 35 can match eol */ +YY_RULE_SETUP +#line 357 "xbt/graphxml.l" +{ + LEAVE; + ETag_node(); + switch (YY_START) { + case S_graph_2: case S_graph_3: case S_graph: SET(S_graph_3); break; + case ROOT_node: SET(EPILOG); break; + } + } + YY_BREAK +case 36: +/* rule 36 can match eol */ +YY_RULE_SETUP +#line 365 "xbt/graphxml.l" +FAIL("Unexpected end-tag `%s': `' expected.",xbt_graph_parse_text); + YY_BREAK +case 37: +YY_RULE_SETUP +#line 366 "xbt/graphxml.l" +FAIL("Unexpected character `%c': `' expected.",xbt_graph_parse_text[0]); + YY_BREAK +case YY_STATE_EOF(E_node): +#line 367 "xbt/graphxml.l" +FAIL("Premature EOF: `' expected."); + YY_BREAK + +/* label CDATA "" + * name CDATA #IMPLIED + * source CDATA #REQUIRED + * target CDATA #REQUIRED + * isDirected (true|false) "true" + * > */ +case 38: +/* rule 38 can match eol */ +YY_RULE_SETUP +#line 377 "xbt/graphxml.l" +{ + A_edge_label = NULL; + A_edge_name = NULL; + A_edge_source = NULL; + A_edge_target = NULL; + A_edge_isDirected = A_edge_isDirected_true; + ENTER(AL_edge); + } + YY_BREAK + +case 39: +/* rule 39 can match eol */ +YY_RULE_SETUP +#line 387 "xbt/graphxml.l" +ENTER(VALUE1); BUFFERSET(A_edge_label); + YY_BREAK +case 40: +/* rule 40 can match eol */ +YY_RULE_SETUP +#line 388 "xbt/graphxml.l" +ENTER(VALUE2); BUFFERSET(A_edge_label); + YY_BREAK +case 41: +/* rule 41 can match eol */ +YY_RULE_SETUP +#line 390 "xbt/graphxml.l" +ENTER(VALUE1); BUFFERSET(A_edge_name); + YY_BREAK +case 42: +/* rule 42 can match eol */ +YY_RULE_SETUP +#line 391 "xbt/graphxml.l" +ENTER(VALUE2); BUFFERSET(A_edge_name); + YY_BREAK +case 43: +/* rule 43 can match eol */ +YY_RULE_SETUP +#line 393 "xbt/graphxml.l" +ENTER(VALUE1); BUFFERSET(A_edge_source); + YY_BREAK +case 44: +/* rule 44 can match eol */ +YY_RULE_SETUP +#line 394 "xbt/graphxml.l" +ENTER(VALUE2); BUFFERSET(A_edge_source); + YY_BREAK +case 45: +/* rule 45 can match eol */ +YY_RULE_SETUP +#line 396 "xbt/graphxml.l" +ENTER(VALUE1); BUFFERSET(A_edge_target); + YY_BREAK +case 46: +/* rule 46 can match eol */ +YY_RULE_SETUP +#line 397 "xbt/graphxml.l" +ENTER(VALUE2); BUFFERSET(A_edge_target); + YY_BREAK +case 47: +/* rule 47 can match eol */ +#line 400 "xbt/graphxml.l" +case 48: +/* rule 48 can match eol */ +YY_RULE_SETUP +#line 400 "xbt/graphxml.l" +A_edge_isDirected = A_edge_isDirected_true; + YY_BREAK +case 49: +/* rule 49 can match eol */ +#line 402 "xbt/graphxml.l" +case 50: +/* rule 50 can match eol */ +YY_RULE_SETUP +#line 402 "xbt/graphxml.l" +A_edge_isDirected = A_edge_isDirected_false; + YY_BREAK +case 51: +YY_RULE_SETUP +#line 404 "xbt/graphxml.l" +{ + if (!A_edge_source) FAIL("Required attribute `source' not set for `edge' element."); + if (!A_edge_target) FAIL("Required attribute `target' not set for `edge' element."); + LEAVE; STag_edge();pcdata = NULL; ENTER(E_edge); + } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 409 "xbt/graphxml.l" +{ + if (!A_edge_source) FAIL("Required attribute `source' not set for `edge' element."); + if (!A_edge_target) FAIL("Required attribute `target' not set for `edge' element."); + LEAVE; STag_edge(); pcdata = NULL; ETag_edge(); + switch (YY_START) { + case S_graph_1: case S_graph_3: case S_graph_5: case S_graph_4: case S_graph: SET(S_graph_5); break; + case ROOT_edge: SET(EPILOG); break; + } + } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 418 "xbt/graphxml.l" +FAIL("Unexpected character `%c' in attribute list of edge element.", xbt_graph_parse_text[0]); + YY_BREAK +case 54: +YY_RULE_SETUP +#line 419 "xbt/graphxml.l" +FAIL("Bad attribute `%s' in `edge' element start tag.",xbt_graph_parse_text); + YY_BREAK +case YY_STATE_EOF(AL_edge): +#line 420 "xbt/graphxml.l" +FAIL("EOF in attribute list of `edge' element."); + YY_BREAK + + +case 55: +/* rule 55 can match eol */ +YY_RULE_SETUP +#line 424 "xbt/graphxml.l" +{ + LEAVE; + ETag_edge(); + switch (YY_START) { + case S_graph_1: case S_graph_3: case S_graph_5: case S_graph_4: case S_graph: SET(S_graph_5); break; + case ROOT_edge: SET(EPILOG); break; + } + } + YY_BREAK +case 56: +/* rule 56 can match eol */ +YY_RULE_SETUP +#line 432 "xbt/graphxml.l" +FAIL("Unexpected end-tag `%s': `' expected.",xbt_graph_parse_text); + YY_BREAK +case 57: +YY_RULE_SETUP +#line 433 "xbt/graphxml.l" +FAIL("Unexpected character `%c': `' expected.",xbt_graph_parse_text[0]); + YY_BREAK +case YY_STATE_EOF(E_edge): +#line 434 "xbt/graphxml.l" +FAIL("Premature EOF: `' expected."); + YY_BREAK + +/* EPILOG: after the root element. */ + +case 58: +YY_RULE_SETUP +#line 440 "xbt/graphxml.l" +{SET(PROLOG); yyless(0); CLEANUP; return -1;} + YY_BREAK +case YY_STATE_EOF(EPILOG): +#line 441 "xbt/graphxml.l" +SUCCEED; + YY_BREAK + +/* CHARACTER DATA. */ + +/* Non-defined standard entities... */ +case 59: +YY_RULE_SETUP +#line 448 "xbt/graphxml.l" +BUFFERPUTC('&'); + YY_BREAK +case 60: +YY_RULE_SETUP +#line 449 "xbt/graphxml.l" +BUFFERPUTC('<'); + YY_BREAK +case 61: +YY_RULE_SETUP +#line 450 "xbt/graphxml.l" +BUFFERPUTC('>'); + YY_BREAK +case 62: +YY_RULE_SETUP +#line 451 "xbt/graphxml.l" +BUFFERPUTC('\''); + YY_BREAK +case 63: +YY_RULE_SETUP +#line 452 "xbt/graphxml.l" +BUFFERPUTC('"'); + YY_BREAK +/* Character entities. */ +case 64: +YY_RULE_SETUP +#line 455 "xbt/graphxml.l" +BUFFERPUTC((unsigned char)atoi(xbt_graph_parse_text+2)); + YY_BREAK +case 65: +YY_RULE_SETUP +#line 456 "xbt/graphxml.l" +BUFFERPUTC((unsigned char)strtol(xbt_graph_parse_text+3,NULL,16)); + YY_BREAK + + +case 66: +/* rule 66 can match eol */ +#line 461 "xbt/graphxml.l" +case 67: +/* rule 67 can match eol */ +#line 462 "xbt/graphxml.l" +case 68: +/* rule 68 can match eol */ +#line 463 "xbt/graphxml.l" +case 69: +/* rule 69 can match eol */ +YY_RULE_SETUP +#line 463 "xbt/graphxml.l" +BUFFERPUTC('\n'); + YY_BREAK + + +case 70: +YY_RULE_SETUP +#line 467 "xbt/graphxml.l" +ENTER(CDATA); + YY_BREAK +case 71: +YY_RULE_SETUP +#line 468 "xbt/graphxml.l" +FAIL("Unexpected `]""]>' in character data."); + YY_BREAK + + +case 72: +YY_RULE_SETUP +#line 472 "xbt/graphxml.l" +BUFFERDONE; LEAVE; + YY_BREAK +case YY_STATE_EOF(VALUE1): +#line 473 "xbt/graphxml.l" +FAIL("EOF in literal (\"'\" expected)."); + YY_BREAK + + +case 73: +YY_RULE_SETUP +#line 477 "xbt/graphxml.l" +BUFFERDONE; LEAVE; + YY_BREAK +case YY_STATE_EOF(VALUE2): +#line 478 "xbt/graphxml.l" +FAIL("EOF in literal (`\"' expected)."); + YY_BREAK + + +case 74: +/* rule 74 can match eol */ +YY_RULE_SETUP +#line 482 "xbt/graphxml.l" +BUFFERPUTC(xbt_graph_parse_text[0]); + YY_BREAK +case 75: +YY_RULE_SETUP +#line 483 "xbt/graphxml.l" +FAIL("Spurious `%c' in character data.",xbt_graph_parse_text[0]); + YY_BREAK + + +case 76: +YY_RULE_SETUP +#line 487 "xbt/graphxml.l" +LEAVE; + YY_BREAK +/* "]""]" BUFFERPUTC(xbt_graph_parse_text[0]); BUFFERPUTC(xbt_graph_parse_text[1]); */ +case 77: +YY_RULE_SETUP +#line 489 "xbt/graphxml.l" +BUFFERPUTC(xbt_graph_parse_text[0]); + YY_BREAK +case YY_STATE_EOF(CDATA): +#line 490 "xbt/graphxml.l" +FAIL("EOF in CDATA section."); + YY_BREAK + +/* 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. */ + +case 78: +/* rule 78 can match eol */ +YY_RULE_SETUP +#line 497 "xbt/graphxml.l" +FAIL("Syntax error on character `%c'.", xbt_graph_parse_text[0]); + YY_BREAK + +case 79: +YY_RULE_SETUP +#line 500 "xbt/graphxml.l" +ECHO; + YY_BREAK +#line 2045 "xbt/graphxml.c" +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(ROOT_graph): +case YY_STATE_EOF(S_graph_2): +case YY_STATE_EOF(S_graph_4): +case YY_STATE_EOF(ROOT_node): +case YY_STATE_EOF(ROOT_edge): +case YY_STATE_EOF(IMPOSSIBLE): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed xbt_graph_parse_in at a new source and called + * xbt_graph_parse_lex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = xbt_graph_parse_in; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( xbt_graph_parse_wrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * xbt_graph_parse_text, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ +} /* end of xbt_graph_parse_lex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + + else + { + size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + xbt_graph_parse_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + xbt_graph_parse_restart(xbt_graph_parse_in ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (void) +{ + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 497 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ + register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 497 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 496); + + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (void) +#else + static int input (void) +#endif + +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + xbt_graph_parse_restart(xbt_graph_parse_in ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( xbt_graph_parse_wrap( ) ) + return EOF; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve xbt_graph_parse_text */ + (yy_hold_char) = *++(yy_c_buf_p); + + if ( c == '\n' ) + + xbt_graph_parse_lineno++; +; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void xbt_graph_parse_restart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + xbt_graph_parse_ensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + xbt_graph_parse__create_buffer(xbt_graph_parse_in,YY_BUF_SIZE ); + } + + xbt_graph_parse__init_buffer(YY_CURRENT_BUFFER,input_file ); + xbt_graph_parse__load_buffer_state( ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void xbt_graph_parse__switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * xbt_graph_parse_pop_buffer_state(); + * xbt_graph_parse_push_buffer_state(new_buffer); + */ + xbt_graph_parse_ensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + xbt_graph_parse__load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (xbt_graph_parse_wrap()) processing, but the only time this flag + * is looked at is after xbt_graph_parse_wrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; +} + +static void xbt_graph_parse__load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + xbt_graph_parse_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE xbt_graph_parse__create_buffer (FILE * file, int size ) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) xbt_graph_parse_alloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) xbt_graph_parse_alloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__create_buffer()" ); + + b->yy_is_our_buffer = 1; + + xbt_graph_parse__init_buffer(b,file ); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with xbt_graph_parse__create_buffer() + * + */ + void xbt_graph_parse__delete_buffer (YY_BUFFER_STATE b ) +{ + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + xbt_graph_parse_free((void *) b->yy_ch_buf ); + + xbt_graph_parse_free((void *) b ); +} + +#ifndef __cplusplus +extern int isatty (int ); +#endif /* __cplusplus */ + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a xbt_graph_parse_restart() or at EOF. + */ + static void xbt_graph_parse__init_buffer (YY_BUFFER_STATE b, FILE * file ) + +{ + int oerrno = errno; + + xbt_graph_parse__flush_buffer(b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then xbt_graph_parse__init_buffer was _probably_ + * called from xbt_graph_parse_restart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void xbt_graph_parse__flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + xbt_graph_parse__load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void xbt_graph_parse_push_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + xbt_graph_parse_ensure_buffer_stack(); + + /* This block is copied from xbt_graph_parse__switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from xbt_graph_parse__switch_to_buffer. */ + xbt_graph_parse__load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void xbt_graph_parse_pop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + xbt_graph_parse__delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + xbt_graph_parse__load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void xbt_graph_parse_ensure_buffer_stack (void) +{ + int num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)xbt_graph_parse_alloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } + + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)xbt_graph_parse_realloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE xbt_graph_parse__scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) xbt_graph_parse_alloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + xbt_graph_parse__switch_to_buffer(b ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to xbt_graph_parse_lex() will + * scan from a @e copy of @a str. + * @param str a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * xbt_graph_parse__scan_bytes() instead. + */ +YY_BUFFER_STATE xbt_graph_parse__scan_string (yyconst char * yy_str ) +{ + + return xbt_graph_parse__scan_bytes(yy_str,strlen(yy_str) ); +} + +/** Setup the input buffer state to scan the given bytes. The next call to xbt_graph_parse_lex() will + * scan from a @e copy of @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE xbt_graph_parse__scan_bytes (yyconst char * bytes, int len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) xbt_graph_parse_alloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in xbt_graph_parse__scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = xbt_graph_parse__scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in xbt_graph_parse__scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + + static void yy_push_state (int new_state ) +{ + if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) + { + yy_size_t new_size; + + (yy_start_stack_depth) += YY_START_STACK_INCR; + new_size = (yy_start_stack_depth) * sizeof( int ); + + if ( ! (yy_start_stack) ) + (yy_start_stack) = (int *) xbt_graph_parse_alloc(new_size ); + + else + (yy_start_stack) = (int *) xbt_graph_parse_realloc((void *) (yy_start_stack),new_size ); + + if ( ! (yy_start_stack) ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; + + BEGIN(new_state); +} + + static void yy_pop_state (void) +{ + if ( --(yy_start_stack_ptr) < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up xbt_graph_parse_text. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + xbt_graph_parse_text[xbt_graph_parse_leng] = (yy_hold_char); \ + (yy_c_buf_p) = xbt_graph_parse_text + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + xbt_graph_parse_leng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the current line number. + * + */ +int xbt_graph_parse_get_lineno (void) +{ + + return xbt_graph_parse_lineno; +} + +/** Get the input stream. + * + */ +FILE *xbt_graph_parse_get_in (void) +{ + return xbt_graph_parse_in; +} + +/** Get the output stream. + * + */ +FILE *xbt_graph_parse_get_out (void) +{ + return xbt_graph_parse_out; +} + +/** Get the length of the current token. + * + */ +int xbt_graph_parse_get_leng (void) +{ + return xbt_graph_parse_leng; +} + +/** Get the current token. + * + */ + +char *xbt_graph_parse_get_text (void) +{ + return xbt_graph_parse_text; +} + +/** Set the current line number. + * @param line_number + * + */ +void xbt_graph_parse_set_lineno (int line_number ) +{ + + xbt_graph_parse_lineno = line_number; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see xbt_graph_parse__switch_to_buffer + */ +void xbt_graph_parse_set_in (FILE * in_str ) +{ + xbt_graph_parse_in = in_str ; +} + +void xbt_graph_parse_set_out (FILE * out_str ) +{ + xbt_graph_parse_out = out_str ; +} + +int xbt_graph_parse_get_debug (void) +{ + return xbt_graph_parse__flex_debug; +} + +void xbt_graph_parse_set_debug (int bdebug ) +{ + xbt_graph_parse__flex_debug = bdebug ; +} + +/* xbt_graph_parse_lex_destroy is for both reentrant and non-reentrant scanners. */ +int xbt_graph_parse_lex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + xbt_graph_parse__delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + xbt_graph_parse_pop_buffer_state(); + } + + /* Destroy the stack itself. */ + xbt_graph_parse_free((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; + + /* Destroy the start condition stack. */ + xbt_graph_parse_free((yy_start_stack) ); + (yy_start_stack) = NULL; + + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * s ) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *xbt_graph_parse_alloc (yy_size_t size ) +{ + return (void *) malloc( size ); +} + +void *xbt_graph_parse_realloc (void * ptr, yy_size_t size ) +{ + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); +} + +void xbt_graph_parse_free (void * ptr ) +{ + free( (char *) ptr ); /* see xbt_graph_parse_realloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#undef YY_NEW_FILE +#undef YY_FLUSH_BUFFER +#undef yy_set_bol +#undef yy_new_buffer +#undef yy_set_interactive +#undef yytext_ptr +#undef YY_DO_BEFORE_ACTION + +#ifdef YY_DECL_IS_OURS +#undef YY_DECL_IS_OURS +#undef YY_DECL +#endif +#line 500 "xbt/graphxml.l" + + + +/* Element context stack lookup. */ +int grahxml_element_context(int i) +{ + return (0 +#include +#include +#include +#include +#include + +/* Generated definitions. */ +#define FLEXML_yylineno +#define FLEXML_BUFFERSTACKSIZE 1000000 + +/* XML processor api. */ +/* FleXML-provided data. */ +const char* pcdata; +AT_edge_target A_edge_target; +AT_node_name A_node_name; +AT_node_label A_node_label; +AT_edge_label A_edge_label; +AT_edge_source A_edge_source; +AT_edge_isDirected A_edge_isDirected; +AT_edge_name A_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*, ...); +const char * grahxml_parse_err_msg(void); + +/* Cleanup */ +static void cleanup(void); +#define CLEANUP cleanup() + +/* Text buffer stack handling. */ +char bufferstack[FLEXML_BUFFERSTACKSIZE]; +static char* limit = bufferstack + FLEXML_BUFFERSTACKSIZE; +typedef struct BufferLast_s { + struct BufferLast_s *old; char* saved; char new1[1]; +} BufferLast; +#ifdef FLEXML_HasMixed +static BufferLast* last = (BufferLast*)0; +#endif +static char* next = bufferstack; + +#define BUFFERSET(P) (P = next) +#define BUFFERPUTC(C) (assert(nextold = last; + l->saved = p; + next = l->new1; + 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_graph AL_graph S_graph S_graph_1 S_graph_2 S_graph_3 S_graph_4 S_graph_5 E_graph +%x ROOT_node AL_node E_node +%x ROOT_edge AL_edge E_edge +%x IMPOSSIBLE + +%{ +/* State names. */ +const char* *grahxml_statenames=NULL; +%} + +%% + + /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ + SET(PROLOG); + /* FleXML_init */ + next = bufferstack; + if(!grahxml_statenames) {grahxml_statenames= (const char **)calloc(IMPOSSIBLE,sizeof(char*)); + grahxml_statenames[PROLOG] = NULL; + grahxml_statenames[DOCTYPE] = NULL; + grahxml_statenames[EPILOG] = NULL; + grahxml_statenames[INCOMMENT] = NULL; + grahxml_statenames[INPI] = NULL; + grahxml_statenames[VALUE1] = NULL; + grahxml_statenames[VALUE2] = NULL; + grahxml_statenames[CDATA] = NULL; + grahxml_statenames[ROOT_graph] = NULL; + grahxml_statenames[AL_graph] = NULL; + grahxml_statenames[S_graph] = "graph"; + grahxml_statenames[S_graph_1] = "graph"; + grahxml_statenames[S_graph_2] = "graph"; + grahxml_statenames[S_graph_3] = "graph"; + grahxml_statenames[S_graph_4] = "graph"; + grahxml_statenames[S_graph_5] = "graph"; + grahxml_statenames[E_graph] = "graph"; + grahxml_statenames[ROOT_node] = NULL; + grahxml_statenames[AL_node] = NULL; + grahxml_statenames[E_node] = "node"; + grahxml_statenames[ROOT_edge] = NULL; + grahxml_statenames[AL_edge] = NULL; + grahxml_statenames[E_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_edge); + "" SET(ROOT_node); + "" SET(ROOT_graph); + "-][^>]*">" FAIL("Bad declaration %s.",yytext); + . FAIL("Unexpected character `%c' in prolog.", yytext[0]); + <> FAIL("EOF in prolog."); +} + + /* RULES DERIVED FROM DTD. */ + + /* */ + +"{ + ">" { + LEAVE; STag_graph();pcdata = NULL; ENTER(S_graph); + } + "/>" { + LEAVE; STag_graph(); pcdata = NULL; ETag_graph(); + switch (YY_START) { + case ROOT_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_graph(); + switch (YY_START) { + case ROOT_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 + * > */ + +"{ + "label"{Eq}\' ENTER(VALUE1); BUFFERSET(A_node_label); + "label"{Eq}\" ENTER(VALUE2); BUFFERSET(A_node_label); + + "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_node_name); + "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_node_name); + + ">" { + if (!A_node_name) FAIL("Required attribute `name' not set for `node' element."); + LEAVE; STag_node();pcdata = NULL; ENTER(E_node); + } + "/>" { + if (!A_node_name) FAIL("Required attribute `name' not set for `node' element."); + LEAVE; STag_node(); pcdata = NULL; ETag_node(); + switch (YY_START) { + case S_graph_2: case S_graph_3: case S_graph: SET(S_graph_3); break; + case ROOT_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_node(); + switch (YY_START) { + case S_graph_2: case S_graph_3: case S_graph: SET(S_graph_3); break; + case ROOT_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 + * isDirected (true|false) "true" + * > */ + +"{ + "label"{Eq}\' ENTER(VALUE1); BUFFERSET(A_edge_label); + "label"{Eq}\" ENTER(VALUE2); BUFFERSET(A_edge_label); + + "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_edge_name); + "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_edge_name); + + "source"{Eq}\' ENTER(VALUE1); BUFFERSET(A_edge_source); + "source"{Eq}\" ENTER(VALUE2); BUFFERSET(A_edge_source); + + "target"{Eq}\' ENTER(VALUE1); BUFFERSET(A_edge_target); + "target"{Eq}\" ENTER(VALUE2); BUFFERSET(A_edge_target); + + "isDirected"{Eq}"'true'" | + "isDirected"{Eq}"\"true\"" A_edge_isDirected = A_edge_isDirected_true; + "isDirected"{Eq}"'false'" | + "isDirected"{Eq}"\"false\"" A_edge_isDirected = A_edge_isDirected_false; + + ">" { + if (!A_edge_source) FAIL("Required attribute `source' not set for `edge' element."); + if (!A_edge_target) FAIL("Required attribute `target' not set for `edge' element."); + LEAVE; STag_edge();pcdata = NULL; ENTER(E_edge); + } + "/>" { + if (!A_edge_source) FAIL("Required attribute `source' not set for `edge' element."); + if (!A_edge_target) FAIL("Required attribute `target' not set for `edge' element."); + LEAVE; STag_edge(); pcdata = NULL; ETag_edge(); + switch (YY_START) { + case S_graph_1: case S_graph_3: case S_graph_5: case S_graph_4: case S_graph: SET(S_graph_5); break; + case ROOT_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_edge(); + switch (YY_START) { + case S_graph_1: case S_graph_3: case S_graph_5: case S_graph_4: case S_graph: SET(S_graph_5); break; + case ROOT_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 grahxml_element_context(int i) +{ + return (0