Mercurial > forge
changeset 1257:7a2af2b41ce2 octave-forge
Xmlread is now finished and fully tested. There's now a easy way for Octave
to exchange data with XML powered languages (Perl and Php).
author | mazet |
---|---|
date | Sat, 31 Jan 2004 21:45:28 +0000 |
parents | 38a6b618440f |
children | bb776b0c5ef8 |
files | main/miscellaneous/Makefile main/miscellaneous/xmlread.cc main/miscellaneous/xmltree.c main/miscellaneous/xmltree.h main/miscellaneous/xmltree_read.act main/miscellaneous/xmltree_read.c main/miscellaneous/xmltree_read.h main/miscellaneous/xmltree_read.l |
diffstat | 8 files changed, 6511 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/main/miscellaneous/Makefile Sat Jan 31 21:39:08 2004 +0000 +++ b/main/miscellaneous/Makefile Sat Jan 31 21:45:28 2004 +0000 @@ -5,7 +5,7 @@ endif -all: dispatch.oct waitbar.oct listen.oct +all: dispatch.oct waitbar.oct listen.oct xmlread.oct waitbar.oct: waitbar.cc $(MKOCTFILE) $(MISCDEFS) waitbar.cc $(TERM_LIB) @@ -22,4 +22,26 @@ listencanfork.o: listencanfork.c $(MKOCTFILE) -c listencanfork.c +xmltree.o: xmltree.c xmltree.h + $(CC) -c $< -o $@ + +ifdef FLEXML +xmltree_read.l: xmltree_read.act octave.dtd + $(FLEXML) -A -a $^ +endif + +ifdef FLEX +xmltree_read.c: xmltree_read.l + $(FLEX) -B -o$@ $< +endif + +xmltree_read.o: xmltree_read.c xmltree_read.h + $(CC) -c $< -o $@ + +xmlread.o: xmlread.cc xmltree_read.h xmltree.h + $(MKOCTFILE) -c $< -o $@ + +xmlread.oct: xmlread.o xmltree_read.o xmltree.o + $(MKOCTFILE) $^ -o $@ + clean: ; -$(RM) *.o octave-core core *.oct *~
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main/miscellaneous/xmlread.cc Sat Jan 31 21:45:28 2004 +0000 @@ -0,0 +1,159 @@ +/* + * Copyright (C) 2004 Laurent Mazet + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* 2004-01-30 + * initial release + */ + +#include <octave/oct.h> +#include <octave/lo-ieee.h> +#include <octave/oct-map.h> +#include <octave/Cell.h> + +extern "C" { +#include "xmltree.h" +#include "xmltree_read.h" +} + +octave_value get_element (element *root) { + int length, rows, columns; + + string_vector tmp_array; + ComplexMatrix tmp_matrix; + Octave_map tmp_structure; + Cell tmp_cell; + octave_value_list tmp_list; + + octave_value retval; + + if (!root) + return retval; + + switch (root->def_value) { + case value_scalar: + switch (root->const_value) { + case const_true: retval = octave_value(true); break; + case const_false: retval = octave_value(false); break; + case const_inf: retval = octave_value(octave_Inf); break; + case const_neginf: retval = octave_value(-octave_Inf); break; + case const_nan: retval = octave_value(octave_NaN); break; + case const_na: retval = octave_value(octave_NA); break; + case const_undef: retval = octave_value(root->scalar_value); break; + } + break; + + case value_complex: + retval = + octave_value(Complex(get_element(root->child).double_value(), + get_element(root->child->next).double_value())); + break; + + case value_string: + retval = octave_value(root->string_value); + break; + + case value_array: + rows = root->rows; + root = root->child; + tmp_array = string_vector(rows); + for (int k=0; (k<rows) && (root); k++, root = root->next) + tmp_array(k) = get_element(root).string_value(); + retval = octave_value(tmp_array); + break; + + case value_matrix: + rows = root->rows; + columns = root->columns; + root = root->child; + tmp_matrix = ComplexMatrix(rows, columns); + for (int k=0; (k<rows) && (root); k++) + for (int l=0; (l<columns) && (root); l++, root = root->next) + tmp_matrix(k, l) = get_element(root).complex_value(); + if (tmp_matrix.all_elements_are_real()) + retval = octave_value(real(tmp_matrix)); + else + retval = octave_value(tmp_matrix); + break; + + case value_structure: + root = root->child; + for (int k=0; root; root = root->next) + if (root->name) + tmp_structure.assign(root->name, get_element(root)); + else { + char *name = new char[7]; + sprintf (name, "__%04d", k++); + warning ("no field name in structure."); + tmp_structure.assign(name, get_element(root)); + delete[] name; + } + retval = octave_value(tmp_structure); + break; + + case value_list: + length = root->length; + root = root->child; + //tmp_list = octave_value_list(length); + for (int k=0; (k<length) && (root); k++, root = root->next) + tmp_list(k) = get_element(root); + retval = octave_value(tmp_list); + break; + + case value_cell: + rows = root->rows; + columns = root->columns; + root = root->child; + tmp_cell = Cell(rows, columns); + for (int k=0; (k<rows) && (root); k++) + for (int l=0; (l<columns) && (root); l++, root = root->next) + tmp_cell(k, l) = get_element(root); + retval = octave_value(tmp_cell); + break; + + default: + warning ("unknown type.\n"); + } + + return retval; +} + +DEFUN_DLD (xmlread, args, nargout, + "-*- texinfo -*-\n" + "@deftypefn {Function File} {@var{value}} gzoom(@var{filenale})\n" + "\n" + "Read a @var{value} from @var{filename} as an XML file\n" + "@end deftypefn") { + + /* Check argument */ + if (args.length() != 1) { + print_usage ("xmlread"); + return octave_value_list(); + } + + /* Read file */ + std::string filename = args(0).string_value(); + element *root = read_xmltree(filename.c_str()); + if (!root) + return octave_value_list(); + + /* step down into the element tree */ + octave_value retval = get_element (root->child); + free_element (root); + + return retval; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main/miscellaneous/xmltree.c Sat Jan 31 21:45:28 2004 +0000 @@ -0,0 +1,180 @@ +/* + * Copyright (C) 2004 Laurent Mazet + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* 2004-01-25 + * initial release + */ + +#include <stdio.h> +#include <stdlib.h> + +#include "xmltree.h" + +element *new_element () { + + element *new; + new = (element *) malloc (sizeof(element)); + if (!new) + perror("xml: no enough memory for new_element()\n"); + + new->next = new->child = NULL; + + new->def_value = value_undef; + new->const_value = const_undef; + new->scalar_value = 0; + new->string_value = NULL; + + new->name = NULL; + new->length = new->rows = new->columns = new->nb_elements = 0; + + return new; +} + +element *new_next (element *pred) { + + element *new = new_element(); + + if (pred) + pred->next = new; + + return new; +} + +element *new_child (element *father) { + + element *new = new_element(); + + if (father) + father->child = new; + + return new; +} + +void free_element (element *root) { + + if (!root) + return; + + if (root->next) + free_element (root->next); + if (root->child) + free_element (root->child); + + if (root->string_value) + free (root->string_value); + if (root->name) + free (root->name); + + free (root); +} + +void print_level(int l) { + int i; + for (i=0; i<l; i++) + printf (" "); +} + +void print_element (element *root, int l) { + + if (!root) + return; + + if (root->name) { + print_level(l); + printf ("name: %s\n", root->name); + } + + print_level(l); + switch (root->def_value) { + case value_scalar: + printf ("scalar: "); + switch (root->const_value) { + case const_true: printf ("true\n"); break; + case const_false: printf ("false\n"); break; + case const_inf: printf ("inf\n"); break; + case const_neginf: printf ("neginf\n"); break; + case const_nan: printf ("nan\n"); break; + case const_na: printf ("na\n"); break; + case const_undef: printf ("%f\n", root->scalar_value); break; + } + break; + case value_data: + printf ("data:\n"); + break; + case value_complex: + printf ("complex:\n"); + break; + case value_string: + printf ("string (%d): %s\n", root->length, root->string_value); + break; + case value_array: + printf ("array (%d):\n", root->rows); + break; + case value_matrix: + printf ("matrix (%d, %d):\n", root->rows, root->columns); + break; + case value_structure: + printf ("structure:\n"); + break; + case value_list: + printf ("list (%d):\n", root->length); + break; + case value_cell: + printf ("cell (%d, %d):\n", root->rows, root->columns); + break; + default: + printf ("???:\n"); + } + + if (root->child) { + print_level(l); + printf ("child:\n"); + print_element (root->child, l+1); + } + + if (root->next) { + print_level(l); + printf ("next:\n"); + print_element (root->next, l); + } +} + +list *new_list(list *father) { + + list *new; + new = (list *) malloc (sizeof(list)); + if (!new) + perror("xml: no enough memory for new_list()\n"); + + new->prev = father; + + new->root = NULL; + + return new; +} + +list *pop_list(list *child) { + list *father; + + father = child->prev; + free (child); + + return father; +} + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main/miscellaneous/xmltree.h Sat Jan 31 21:45:28 2004 +0000 @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2004 Laurent Mazet + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* 2004-01-25 + * initial release + */ + +/* + xmltree structure + */ + +#if !defined(__XMLTREE_H__) +#define __XMLTREE_H__ + +typedef enum { + value_undef = 0, + value_scalar, + value_complex, + value_string, + value_array, + value_matrix, + value_structure, + value_list, + value_cell, + value_data } t_value; + +typedef enum { + const_undef = 0, + const_true, + const_false, + const_inf, + const_neginf, + const_na, + const_nan } t_const; + +typedef struct _element { + struct _element *next; + struct _element *child; + + /* values */ + t_value def_value; + t_const const_value; + double scalar_value; + char *string_value; + + /* parameters */ + char *name; + int length; + int rows; + int columns; + + /* check */ + int nb_elements; + +} element; + +typedef struct _list { + struct _list *prev; + + element **root; +} list; + +element *new_element (); +element *new_next (element *pred); +element *new_child (element *father); +void free_element (element *root); +void print_element (element *root, int l); + +list *new_list(list *father); +list *pop_list(list *child); + +#endif /* __XMLTREE_H__ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main/miscellaneous/xmltree_read.act Sat Jan 31 21:45:28 2004 +0000 @@ -0,0 +1,348 @@ +<!-- -*- XML -*- --> +<!-- + -- Copyright (C) 2004 Laurent Mazet + -- + -- This program is free software; you can redistribute it and/or modify + -- it under the terms of the GNU General Public License as published by + -- the Free Software Foundation; either version 2 of the License, or + -- (at your option) any later version. + -- + -- This program is distributed in the hope that it will be useful, + -- but WITHOUT ANY WARRANTY; without even the implied warranty of + -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + -- GNU General Public License for more details. + -- + -- You should have received a copy of the GNU General Public License + -- along with this program; if not, write to the Free Software + -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + --> + +<!-- 2004-01-25 + -- initial release + --> + +<!DOCTYPE actions SYSTEM "flexml-act.dtd"> + +<actions> + +<!-- Top --> + +<top><![CDATA[ +#include <stdlib.h> +#include "xmltree.h" + +#define warning perror + +element **current; +element *root; +list *lastlist; +]]></top> + +<!-- Data --> + +<start tag='octave'><![CDATA[ +root = new_element(); +root->def_value = value_data; +current = &(root->child); + +lastlist = new_list(lastlist); +lastlist->root = current; +]]></start> + +<end tag='octave'><![CDATA[ +current = lastlist->root; +lastlist = pop_list(lastlist); +current = &((*current)->next); +]]></end> + +<!-- Scalar --> + +<start tag='scalar'><![CDATA[ +*current = new_element(); + +if ({name}) { + (*current)->name = (char *) malloc(strlen({name})+1); + strcpy ((*current)->name, {name}); +} + +(*current)->def_value = value_scalar; +switch ({value}) { + case {value=true}: (*current)->const_value = const_true; break; + case {value=false}: (*current)->const_value = const_false; break; + case {value=inf}: (*current)->const_value = const_inf; break; + case {value=neginf}: (*current)->const_value = const_neginf; break; + case {value=nan}: (*current)->const_value = const_nan; break; + case {value=na}: (*current)->const_value = const_na; break; + default: (*current)->const_value = const_undef; +} +]]></start> + +<end tag='scalar'><![CDATA[ +if (((*current)->const_value == const_undef) && ({#PCDATA})) + (*current)->scalar_value = strtod ({#PCDATA}, NULL); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); +]]></end> + +<!-- String --> + +<start tag='string'><![CDATA[ +*current = new_element(); + +if ({name}) { + (*current)->name = (char *) malloc(strlen({name})+1); + strcpy ((*current)->name, {name}); +} + +if ({length}) + (*current)->length = strtol ({length}, NULL, 10); + +(*current)->def_value = value_string; +]]></start> + +<end tag='string'><![CDATA[ +if ({#PCDATA}) { + + int len = strlen({#PCDATA}); + /* check length parameter */ + if ((*current)->length != len) { + warning("incorrect length parameter for string\n"); + (*current)->length = len; + } + + (*current)->string_value = (char *) malloc ((len+1) * sizeof(char)); + strcpy((*current)->string_value, {#PCDATA}); +} + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); +]]></end> + +<!-- Complex --> + +<start tag='complex'><![CDATA[ +*current = new_element(); + +if ({name}) { + (*current)->name = (char *) malloc(strlen({name})+1); + strcpy ((*current)->name, {name}); +} + +(*current)->def_value = value_complex; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); +]]></start> + +<end tag='complex'><![CDATA[ +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); +]]></end> + +<!-- Array --> + +<start tag='array'><![CDATA[ +*current = new_element(); + +if ({name}) { + (*current)->name = (char *) malloc(strlen({name})+1); + strcpy ((*current)->name, {name}); +} + +if ({rows}) + (*current)->rows = strtol ({rows}, NULL, 10); + +(*current)->def_value = value_array; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); +]]></start> + +<end tag='array'><![CDATA[ +/* check rows parameter */ +if ((*(lastlist->root))->rows != (*(lastlist->root))->nb_elements) { + warning("incorrect length parameter for array\n"); + (*(lastlist->root))->rows = (*(lastlist->root))->nb_elements; +} + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); +]]></end> + +<!-- Matrix --> + +<start tag='matrix'><![CDATA[ +*current = new_element(); + +if ({name}) { + (*current)->name = (char *) malloc(strlen({name})+1); + strcpy ((*current)->name, {name}); +} + +if ({rows}) + (*current)->rows = strtol ({rows}, NULL, 10); + +if ({columns}) + (*current)->columns = strtol ({columns}, NULL, 10); + +(*current)->def_value = value_matrix; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); +]]></start> + +<end tag='matrix'><![CDATA[ +/* check (rows, columns) parameters */ +if ((*(lastlist->root))->rows * (*(lastlist->root))->columns != + (*(lastlist->root))->nb_elements) { + warning("incorrect (rows, columns) parameters for matrix: reshaping matrix into vector\n"); + (*(lastlist->root))->rows = 1; + (*(lastlist->root))->columns = (*(lastlist->root))->nb_elements; +} + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); +]]></end> + +<!-- Structure --> + +<start tag='structure'><![CDATA[ +*current = new_element(); + +if ({name}) { + (*current)->name = (char *) malloc(strlen({name})+1); + strcpy ((*current)->name, {name}); +} + +(*current)->def_value = value_structure; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); +]]></start> + +<end tag='structure'><![CDATA[ +/* no check possible (sic) */ + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); +]]></end> + +<!-- List --> + +<start tag='list'><![CDATA[ +*current = new_element(); + +if ({name}) { + (*current)->name = (char *) malloc(strlen({name})+1); + strcpy ((*current)->name, {name}); +} + +if ({length}) + (*current)->length = strtol ({length}, NULL, 10); + +(*current)->def_value = value_list; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); +]]></start> + +<end tag='list'><![CDATA[ +/* check length parameter */ +if ((*(lastlist->root))->length != (*(lastlist->root))->nb_elements) { + warning("incorrect length parameter for list\n"); + (*(lastlist->root))->length = (*(lastlist->root))->nb_elements; +} + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); +]]></end> + +<!-- Cell --> + +<start tag='cell'><![CDATA[ +*current = new_element(); + +if ({name}) { + (*current)->name = (char *) malloc(strlen({name})+1); + strcpy ((*current)->name, {name}); +} + +if ({rows}) + (*current)->rows = strtol ({rows}, NULL, 10); + +if ({columns}) + (*current)->columns = strtol ({columns}, NULL, 10); + +(*current)->def_value = value_cell; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); +]]></start> + +<end tag='cell'><![CDATA[ +/* check (rows, columns) parameters */ +if ((*(lastlist->root))->rows * (*(lastlist->root))->columns != + (*(lastlist->root))->nb_elements) { + warning("incorrect (rows, columns) parameters for cell: reshaping cell into list\n"); + (*(lastlist->root))->def_value = value_list; + (*(lastlist->root))->length = (*(lastlist->root))->nb_elements; +} + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); +]]></end> + +<!-- Main --> + +<main> +element *read_xmltree (const char *file) { + + current = NULL; + root = NULL; + lastlist = NULL; + + yyin = fopen(file, "r"); + if (!yyin) + perror("can't open file\n"); + + yylex(); + fclose(yyin); + + return root; +} +</main> + +</actions>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main/miscellaneous/xmltree_read.c Sat Jan 31 21:45:28 2004 +0000 @@ -0,0 +1,4442 @@ +#line 2 "xmltree_read.c" +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header$ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include <stdio.h> +#include <errno.h> + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include <stdlib.h> +#ifndef _WIN32 +#include <unistd.h> +#else +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif +#endif + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include <io.h> +#include <stdlib.h> +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#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 yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext 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). + */ +typedef unsigned int yy_size_t; + + +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; + + /* 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 yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* 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". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* 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 yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + + +#define yywrap() 1 +#define YY_SKIP_YYWRAP +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 157 +#define YY_END_OF_BUFFER 158 +static yyconst short int yy_accept[1064] = + { 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, 0, 0, 0, + 0, 0, 0, 0, 158, 156, 23, 10, 10, 23, + + 23, 135, 10, 135, 5, 6, 5, 8, 9, 8, + 151, 143, 144, 152, 149, 152, 150, 155, 143, 144, + 155, 157, 157, 27, 10, 27, 27, 27, 25, 157, + 31, 10, 31, 157, 51, 10, 51, 51, 51, 49, + 51, 51, 152, 151, 157, 60, 10, 60, 60, 60, + 58, 60, 64, 10, 64, 157, 72, 10, 72, 72, + 72, 70, 72, 72, 152, 157, 83, 10, 83, 83, + 83, 81, 83, 83, 87, 10, 87, 87, 157, 97, + 10, 97, 97, 97, 95, 97, 97, 97, 101, 10, + 101, 157, 101, 157, 107, 10, 107, 107, 107, 105, + + 107, 152, 157, 118, 10, 118, 118, 118, 116, 118, + 118, 152, 157, 131, 10, 131, 131, 131, 129, 131, + 131, 131, 152, 10, 0, 2, 2, 0, 4, 7, + 146, 145, 0, 0, 0, 0, 0, 154, 0, 26, + 28, 0, 0, 0, 0, 0, 0, 50, 52, 52, + 52, 0, 0, 0, 0, 59, 61, 61, 0, 0, + 71, 73, 73, 73, 0, 82, 84, 84, 84, 0, + 0, 96, 98, 98, 98, 98, 0, 0, 106, 108, + 108, 0, 117, 119, 119, 119, 0, 0, 130, 132, + 132, 132, 132, 0, 0, 0, 0, 0, 3, 0, + + 0, 0, 0, 0, 0, 0, 153, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 52, 52, 0, 0, + 0, 148, 61, 0, 0, 0, 73, 73, 0, 0, + 84, 84, 0, 0, 0, 98, 98, 98, 0, 0, + 0, 108, 0, 0, 119, 119, 0, 0, 132, 132, + 132, 0, 0, 0, 22, 1, 0, 0, 141, 0, + 0, 0, 138, 137, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 30, 0, 52, 52, 0, 0, + 0, 54, 0, 61, 0, 0, 63, 0, 0, 73, + 73, 0, 0, 75, 0, 84, 84, 0, 0, 86, + + 0, 0, 98, 98, 98, 0, 0, 100, 0, 0, + 108, 0, 0, 110, 0, 119, 119, 0, 0, 121, + 0, 132, 132, 132, 0, 0, 134, 0, 0, 0, + 142, 136, 0, 0, 0, 0, 122, 0, 111, 0, + 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, + 0, 73, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, + 119, 0, 0, 0, 132, 0, 0, 0, 0, 0, + 0, 0, 0, 12, 0, 139, 140, 0, 76, 122, + 0, 111, 0, 0, 0, 0, 0, 48, 47, 0, + + 0, 0, 0, 0, 57, 56, 0, 73, 0, 69, + 68, 0, 0, 80, 79, 0, 78, 77, 0, 0, + 98, 0, 94, 93, 0, 90, 89, 0, 0, 104, + 103, 0, 119, 0, 115, 114, 0, 132, 0, 128, + 127, 0, 124, 123, 0, 0, 0, 11, 24, 76, + 0, 32, 65, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 88, 98, 0, 0, 0, + 0, 0, 120, 132, 0, 133, 0, 0, 24, 55, + 32, 65, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 67, 66, + + 0, 0, 85, 88, 0, 0, 0, 0, 0, 113, + 112, 0, 0, 0, 0, 55, 0, 0, 29, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 147, 0, 53, 0, 0, 74, 0, 92, 91, + 0, 99, 0, 0, 126, 125, 0, 0, 102, 0, + 0, 44, 0, 0, 0, 0, 0, 0, 43, 0, + 0, 0, 0, 0, 62, 0, 0, 0, 0, 0, + 0, 0, 0, 102, 0, 40, 46, 0, 0, 0, + 0, 39, 45, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, + + 0, 0, 35, 0, 0, 109, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 38, 0, 0, 37, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 42, 0, 41, 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, 34, 33, 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, 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, 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, 20, + 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 17, 0, 14, 0, + 13, 0, 16, 0, 0, 0, 15, 0, 0, 0, + 0, 19, 0 + } ; + +static yyconst int 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, 21, 34, 35, + + 36, 37, 38, 39, 40, 14, 14, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 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 int yy_meta[55] = + { 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, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5 + } ; + +static yyconst short int yy_base[1112] = + { 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, 180, 0, + 232, 234, 241, 249, 266, 309, 284, 287, 290, 327, + 330, 333, 351, 354, 370, 0, 422, 424, 431, 439, + 456, 0, 509, 512, 515, 518, 533, 536, 539, 542, + 557, 560, 563, 566, 582, 0, 635, 638, 641, 644, + 659, 662, 665, 668, 683, 686, 702, 745, 727, 762, + 720, 723, 794, 0, 846, 848, 765, 769, 880, 0, + 932, 934, 0, 0, 3088, 3089, 3089, 111, 114, 47, + + 62, 3089, 117, 150, 3089, 3089, 3077, 3089, 3089, 3068, + 3089, 3081, 3081, 932, 3089, 3089, 3089, 3089, 3079, 3079, + 3049, 3089, 236, 3089, 168, 3062, 0, 155, 3089, 938, + 3089, 173, 242, 936, 3089, 256, 3061, 0, 159, 3089, + 3045, 3044, 244, 3044, 940, 3089, 357, 3057, 0, 343, + 3089, 3041, 3089, 361, 432, 939, 3089, 446, 3055, 0, + 426, 3089, 3036, 3038, 434, 942, 3089, 689, 3052, 0, + 528, 3089, 3036, 3024, 3089, 692, 941, 770, 949, 3089, + 738, 3049, 0, 552, 3089, 3022, 3032, 3020, 3089, 788, + 964, 958, 774, 962, 3089, 855, 3045, 0, 654, 3089, + + 3029, 1008, 975, 3089, 863, 3043, 0, 678, 3089, 3024, + 3026, 3046, 977, 3089, 866, 3039, 0, 855, 3089, 3012, + 3022, 3010, 3041, 869, 34, 2999, 3089, 3041, 3032, 3089, + 3089, 3089, 37, 40, 3000, 2999, 2997, 3028, 3011, 3089, + 0, 2997, 260, 3003, 73, 2998, 3007, 3089, 0, 2998, + 2998, 148, 2990, 3019, 2992, 3089, 0, 2993, 3000, 2984, + 3089, 0, 2989, 2989, 2982, 3089, 0, 2987, 2976, 2994, + 2993, 3089, 0, 2984, 2982, 2971, 2980, 2972, 3089, 0, + 2978, 2971, 3089, 0, 2975, 2975, 2975, 2979, 3089, 0, + 2973, 2971, 2960, 2977, 2992, 2999, 281, 2966, 3089, 148, + + 0, 2962, 2962, 2990, 2989, 2959, 3089, 2953, 2954, 2959, + 2957, 2950, 2964, 2949, 997, 1000, 2959, 2944, 2971, 1005, + 1026, 3089, 2956, 1022, 1029, 2944, 2952, 2953, 1033, 1051, + 2952, 2939, 1059, 1062, 2937, 2935, 2948, 2935, 1068, 1072, + 2935, 2945, 1079, 1085, 2942, 2943, 1089, 1092, 2928, 2941, + 2928, 1109, 1112, 2957, 3089, 3089, 17, 2933, 3089, 2958, + 2957, 2923, 3089, 3089, 2921, 2936, 2935, 2926, 2921, 2840, + 2847, 255, 1115, 1118, 3089, 1121, 1138, 2842, 2852, 1141, + 1147, 3089, 1150, 1154, 1158, 1170, 3089, 1175, 2832, 2820, + 1178, 1182, 1187, 3089, 1194, 1199, 1204, 1207, 1211, 3089, + + 1216, 2819, 2821, 1220, 1228, 1224, 1236, 3089, 1244, 2810, + 1247, 1253, 1256, 3089, 1263, 2808, 1266, 1273, 1276, 3089, + 1282, 2812, 1285, 1294, 1301, 1304, 3089, 1310, 321, 1313, + 3089, 3089, 2836, 2829, 2788, 2780, 873, 2788, 1055, 2791, + 2776, 2780, 1321, 1331, 1334, 1342, 2789, 1353, 1358, 1361, + 1370, 2765, 1374, 1377, 1393, 1396, 1399, 1414, 1417, 1425, + 2654, 2650, 1432, 1435, 1443, 1448, 1459, 1462, 1465, 1478, + 2653, 1481, 1484, 1497, 2648, 1500, 1505, 1516, 1520, 1532, + 698, 2672, 1535, 3089, 2670, 3089, 3089, 2651, 1528, 1538, + 2650, 1541, 2638, 2646, 2634, 1545, 1552, 3089, 3089, 1562, + + 1565, 2653, 1573, 1578, 3089, 3089, 1586, 1590, 1596, 3089, + 3089, 1606, 1609, 3089, 3089, 1617, 3089, 3089, 1626, 2624, + 2628, 1629, 3089, 3089, 1637, 3089, 3089, 1648, 1651, 3089, + 3089, 1659, 1665, 1669, 3089, 3089, 1681, 2623, 1688, 3089, + 3089, 1698, 3089, 3089, 1706, 320, 333, 3089, 1709, 1712, + 2617, 1715, 1718, 2617, 1723, 1726, 1694, 1696, 2645, 1745, + 1748, 1751, 1758, 1767, 1754, 1771, 1774, 1777, 1784, 1794, + 1797, 1805, 3089, 1810, 1813, 3089, 284, 41, 1816, 1822, + 1832, 1835, 2596, 1838, 2606, 2594, 51, 2573, 2569, 2539, + 2518, 309, 2482, 2213, 2201, 1841, 1844, 1848, 3089, 3089, + + 1861, 1864, 3089, 1867, 1870, 1874, 1882, 1886, 1889, 3089, + 3089, 1899, 1903, 1911, 505, 1915, 2137, 1919, 3089, 2096, + 2062, 694, 2026, 2010, 1985, 1920, 1874, 130, 1872, 1858, + 1825, 3089, 1922, 3089, 1928, 1931, 3089, 1939, 3089, 3089, + 1948, 3089, 1951, 1954, 3089, 3089, 1997, 283, 1968, 1756, + 1787, 3089, 1736, 1700, 1670, 1659, 1622, 1650, 3089, 1588, + 1519, 1436, 1417, 1971, 3089, 1974, 509, 536, 326, 711, + 228, 1050, 506, 1977, 1373, 3089, 3089, 1344, 1346, 1312, + 1284, 3089, 3089, 1256, 1286, 1157, 1984, 530, 411, 533, + 631, 105, 683, 972, 635, 634, 1141, 1089, 3089, 953, + + 943, 914, 3089, 813, 1991, 3089, 1113, 944, 977, 970, + 996, 1308, 1060, 1088, 2001, 3089, 778, 740, 3089, 689, + 612, 720, 2004, 1061, 2009, 640, 1086, 1309, 1003, 845, + 2030, 2040, 3089, 542, 3089, 400, 2022, 2033, 638, 2050, + 1111, 1049, 1145, 979, 1117, 2053, 2078, 2110, 333, 204, + 2070, 1157, 1151, 1243, 2073, 2102, 2128, 2131, 1149, 2149, + 2181, 17, 6, 1291, 1020, 2141, 1080, 2173, 2200, 2203, + 2206, 1225, 511, 3089, 3089, 1264, 1215, 2212, 1272, 1374, + 1392, 1394, 1412, 1217, 1300, 508, 1495, 837, 1340, 1477, + 1534, 1542, 2223, 1021, 556, 1567, 762, 1364, 1396, 1430, + + 1460, 2233, 931, 2240, 1492, 2244, 1329, 1366, 1452, 1473, + 1604, 2250, 2261, 1533, 2269, 1640, 1656, 1661, 1671, 1619, + 2279, 632, 1388, 1680, 1598, 1811, 2287, 2290, 2296, 2299, + 1498, 1814, 1831, 1218, 1332, 2307, 1351, 1422, 2317, 2325, + 2335, 2343, 1554, 1583, 1630, 1565, 1607, 2353, 1627, 1772, + 1876, 1920, 1921, 1941, 1972, 1973, 1979, 2045, 1764, 1804, + 1878, 1705, 1929, 2048, 2103, 1949, 1950, 1669, 1776, 1910, + 2089, 2090, 2144, 2145, 2177, 2361, 1996, 2032, 1585, 1810, + 2199, 2204, 2049, 2051, 2052, 2120, 2121, 2122, 2174, 2201, + 2211, 2227, 2364, 2085, 2256, 1371, 1437, 2231, 2237, 1476, + + 1747, 2251, 2297, 2300, 2318, 2336, 2342, 2354, 2356, 2130, + 2176, 1863, 2221, 2010, 2248, 2358, 2359, 2295, 2367, 2330, + 2332, 2362, 2366, 2368, 2370, 2372, 2375, 2278, 2298, 2383, + 2384, 1457, 2379, 2378, 2380, 2381, 2385, 2259, 2286, 2306, + 2322, 2382, 2386, 2388, 2389, 2387, 2390, 2392, 2393, 2391, + 2394, 2397, 2412, 2414, 2416, 2424, 2426, 2427, 2435, 2436, + 2438, 2439, 2440, 2434, 2437, 2423, 2441, 2442, 2443, 2451, + 2453, 2448, 2450, 2456, 2457, 2458, 2461, 2462, 2463, 2464, + 2466, 2455, 2468, 2469, 2470, 1978, 2485, 2477, 2482, 2154, + 2493, 2471, 2489, 2490, 2491, 2492, 2495, 2496, 2497, 2498, + + 2500, 2515, 2513, 2524, 2505, 2506, 2545, 2517, 2525, 2532, + 2533, 2535, 2538, 2539, 2540, 2514, 2519, 2562, 2574, 3089, + 2544, 2551, 2579, 3089, 2553, 2575, 2581, 2576, 2582, 2580, + 2584, 2586, 2573, 2578, 2603, 3089, 2597, 2592, 2614, 2620, + 2623, 2626, 2591, 2593, 2631, 2643, 3089, 2648, 3089, 2651, + 3089, 2654, 3089, 2596, 2601, 2660, 3089, 2642, 2650, 2671, + 2677, 3089, 3089, 2695, 2702, 2709, 2716, 2723, 2730, 2737, + 2744, 2751, 2758, 2765, 2772, 2779, 2786, 2793, 2798, 2803, + 2808, 2813, 2818, 2823, 2828, 2833, 2838, 2845, 2848, 2851, + 2854, 2857, 2860, 2863, 2866, 2869, 2872, 2879, 2883, 2889, + + 2895, 2901, 2907, 2913, 2919, 2925, 2931, 2937, 2944, 2951, + 2958 + } ; + +static yyconst short int yy_def[1112] = + { 0, + 1064, 1064, 1065, 1065, 1065, 1065, 1066, 1066, 1067, 1067, + 1068, 1068, 1069, 1069, 1069, 1069, 1070, 1070, 1071, 1071, + 1072, 1072, 1071, 1071, 1073, 1073, 1071, 1071, 1063, 29, + 1069, 1069, 1071, 1071, 1074, 1074, 1071, 1071, 1071, 1071, + 1075, 1075, 1071, 1071, 1063, 45, 1069, 1069, 1071, 1071, + 1063, 51, 1071, 1071, 1071, 1071, 1071, 1071, 1076, 1076, + 1076, 1076, 1071, 1071, 1063, 65, 1077, 1077, 1071, 1071, + 1077, 1077, 1077, 1077, 1071, 1071, 1078, 1078, 1069, 1069, + 1071, 1071, 1063, 83, 1069, 1069, 1071, 1071, 1063, 89, + 1069, 1069, 1064, 1064, 1063, 1063, 1063, 1063, 1063, 1063, + + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1079, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1080, 1063, 1063, + 1080, 1080, 1063, 1063, 1063, 1063, 1063, 1063, 1081, 1063, + 1063, 1081, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1082, + 1063, 1063, 1082, 1082, 1063, 1063, 1063, 1063, 1063, 1083, + 1063, 1063, 1083, 1083, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1084, 1063, 1063, 1084, 1084, 1084, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1085, 1063, 1063, + + 1085, 1063, 1063, 1063, 1063, 1063, 1086, 1063, 1063, 1086, + 1086, 202, 1063, 1063, 1063, 1063, 1087, 1063, 1063, 1087, + 1087, 1087, 202, 1063, 1088, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1079, 1063, 1063, 1063, 1063, 1089, 1063, 1063, 1080, 1080, + 1080, 1063, 1090, 1063, 1063, 1063, 1081, 1081, 1091, 1063, + 1063, 1082, 1082, 1082, 1092, 1063, 1083, 1083, 1083, 1093, + 1063, 1063, 1084, 1084, 1084, 1084, 1094, 1063, 1063, 1085, + 1085, 1095, 1063, 1086, 1086, 1086, 1096, 1063, 1063, 1087, + 1087, 1087, 1087, 1097, 1098, 1063, 1098, 1063, 1063, 1063, + + 1099, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1100, 1100, 1080, 1080, 1063, 1101, + 1101, 1063, 1081, 1102, 1102, 1063, 1082, 1082, 1103, 1103, + 1083, 1083, 1104, 1104, 1063, 1084, 1084, 1084, 1105, 1105, + 1063, 1085, 1106, 1106, 1086, 1086, 1107, 1107, 1087, 1087, + 1087, 1108, 1108, 1098, 1063, 1063, 1098, 1063, 1063, 1099, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1100, 1063, 1100, 1080, 1080, 1063, 1063, + 1101, 1063, 1101, 1081, 1063, 1102, 1063, 1102, 1063, 1082, + 1082, 1063, 1103, 1063, 1103, 1083, 1083, 1063, 1104, 1063, + + 1104, 1063, 1084, 1084, 1084, 1063, 1105, 1063, 1105, 1063, + 1085, 1063, 1106, 1063, 1106, 1086, 1086, 1063, 1107, 1063, + 1107, 1087, 1087, 1087, 1063, 1108, 1063, 1108, 1098, 1109, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1100, 1063, 1063, 1080, 1063, 1101, 1063, 1063, + 1102, 1082, 1063, 1063, 1103, 1063, 1063, 1063, 1063, 1104, + 1063, 1084, 1063, 1063, 1063, 1063, 1105, 1063, 1063, 1106, + 1086, 1063, 1063, 1107, 1087, 1063, 1063, 1063, 1063, 1108, + 1098, 1109, 1109, 1063, 1109, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1100, 1063, 1063, 1063, 1063, + + 1063, 1063, 1101, 1063, 1063, 1063, 1102, 1082, 1063, 1063, + 1063, 1103, 1063, 1063, 1063, 1063, 1063, 1063, 1104, 1063, + 1084, 1063, 1063, 1063, 1063, 1063, 1063, 1105, 1063, 1063, + 1063, 1106, 1086, 1063, 1063, 1063, 1107, 1087, 1063, 1063, + 1063, 1063, 1063, 1063, 1108, 1098, 1109, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1100, 1063, 1063, 1063, 1063, 1101, + 1102, 1063, 1063, 1103, 1104, 1063, 1084, 1105, 1106, 1063, + 1063, 1063, 1063, 1087, 1063, 1063, 1098, 1109, 1063, 1063, + 1063, 1063, 1063, 1100, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1101, 1102, 1063, 1063, 1063, + + 1103, 1063, 1063, 1063, 1063, 1063, 1105, 1106, 1063, 1063, + 1063, 1063, 1063, 1098, 1109, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1102, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1106, 1063, 1063, 1063, 1098, 1109, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1106, 1098, 1098, 1098, 1098, + 1098, 1098, 1109, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1106, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1109, 1063, 1063, 1063, 1063, + + 1063, 1063, 1063, 1063, 1063, 1063, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1109, 1063, 1063, 1063, 1063, 1063, + 1063, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1109, 1109, 1063, 1063, 1063, 1063, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1109, 1110, 1111, 1063, 1063, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1110, + 1111, 1063, 1063, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1109, 1063, 1063, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1063, + 1098, 1098, 1098, 1063, 1098, 1098, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1063, 1098, 1098, 1098, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1063, 1098, 1063, 1098, + 1063, 1098, 1063, 1098, 1098, 1098, 1063, 1098, 1098, 1098, + 1098, 1063, 0, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063 + } ; + +static yyconst short int yy_nxt[3144] = + { 0, + 1063, 98, 99, 98, 98, 99, 98, 98, 99, 98, + 98, 99, 98, 106, 775, 100, 106, 109, 100, 109, + 107, 101, 774, 107, 101, 103, 99, 103, 103, 99, + 103, 112, 113, 110, 355, 110, 114, 115, 429, 104, + 112, 113, 104, 296, 116, 114, 115, 112, 113, 300, + 117, 225, 114, 116, 112, 113, 297, 117, 484, 114, + 116, 119, 120, 119, 120, 226, 225, 116, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, + 227, 302, 123, 622, 303, 123, 623, 615, 130, 301, + 121, 130, 121, 124, 125, 99, 125, 124, 124, 124, + + 124, 124, 124, 124, 126, 124, 313, 124, 128, 124, + 129, 124, 224, 224, 224, 224, 224, 224, 224, 224, + 224, 314, 355, 124, 124, 124, 125, 99, 125, 124, + 124, 124, 124, 124, 124, 124, 126, 124, 659, 124, + 128, 124, 129, 124, 132, 99, 132, 132, 99, 132, + 99, 99, 99, 711, 228, 124, 124, 296, 133, 228, + 300, 133, 359, 228, 134, 99, 99, 99, 227, 224, + 224, 224, 660, 227, 224, 224, 224, 227, 319, 134, + 135, 136, 99, 136, 135, 135, 135, 135, 135, 135, + 135, 137, 135, 138, 135, 139, 135, 140, 135, 138, + + 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, + 135, 135, 138, 138, 138, 138, 138, 138, 138, 138, + 138, 138, 141, 138, 138, 138, 138, 138, 138, 138, + 142, 138, 138, 138, 112, 113, 112, 113, 763, 114, + 228, 114, 99, 99, 99, 355, 228, 143, 252, 143, + 99, 99, 99, 246, 227, 253, 145, 224, 224, 224, + 227, 693, 227, 144, 145, 144, 146, 147, 99, 147, + 146, 146, 146, 146, 146, 146, 146, 148, 146, 239, + 146, 150, 146, 151, 146, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 441, 310, 146, 146, 355, 134, + + 484, 355, 134, 311, 442, 134, 357, 614, 152, 146, + 147, 99, 147, 146, 146, 146, 146, 146, 146, 146, + 148, 146, 673, 146, 150, 146, 151, 146, 99, 99, + 99, 154, 99, 154, 154, 99, 154, 355, 355, 146, + 146, 628, 134, 355, 629, 155, 577, 228, 155, 481, + 484, 152, 99, 99, 99, 99, 99, 99, 224, 224, + 224, 227, 224, 224, 224, 691, 156, 762, 578, 156, + 157, 158, 99, 158, 157, 157, 157, 157, 157, 157, + 157, 159, 157, 160, 157, 161, 157, 162, 157, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + + 157, 157, 160, 160, 160, 160, 160, 160, 160, 160, + 163, 160, 164, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 112, 113, 112, 113, 355, 114, + 228, 114, 99, 99, 99, 750, 228, 165, 252, 165, + 99, 99, 99, 259, 227, 265, 166, 224, 224, 224, + 227, 708, 227, 144, 166, 144, 167, 168, 99, 168, + 167, 167, 167, 167, 167, 167, 167, 169, 167, 170, + 167, 171, 167, 172, 167, 170, 170, 170, 170, 170, + 170, 170, 170, 170, 170, 170, 167, 167, 170, 170, + 170, 170, 170, 170, 170, 170, 170, 170, 173, 170, + + 170, 170, 174, 170, 170, 170, 170, 170, 170, 170, + 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 484, 484, 156, 355, 355, 156, 484, 485, + 156, 795, 228, 156, 99, 99, 99, 99, 99, 99, + 176, 99, 176, 176, 99, 176, 227, 355, 156, 696, + 355, 156, 648, 355, 177, 688, 228, 177, 176, 99, + 176, 176, 99, 176, 99, 99, 99, 99, 99, 99, + 227, 689, 178, 355, 709, 178, 707, 749, 179, 690, + 804, 179, 180, 181, 99, 181, 180, 180, 180, 180, + 180, 180, 180, 182, 180, 183, 180, 184, 180, 185, + + 180, 183, 183, 183, 183, 183, 183, 183, 183, 183, + 183, 183, 180, 180, 183, 186, 183, 183, 183, 183, + 183, 183, 183, 183, 187, 183, 183, 183, 188, 183, + 183, 183, 183, 183, 183, 183, 190, 99, 190, 190, + 99, 190, 99, 99, 99, 99, 99, 99, 355, 355, + 191, 484, 355, 191, 736, 355, 192, 355, 228, 192, + 190, 99, 190, 190, 99, 190, 190, 99, 190, 190, + 99, 190, 227, 753, 191, 834, 715, 191, 710, 741, + 193, 714, 228, 193, 99, 99, 99, 99, 99, 99, + 224, 224, 224, 224, 224, 224, 227, 735, 194, 652, + + 355, 194, 195, 196, 99, 196, 195, 195, 195, 195, + 195, 195, 195, 197, 195, 355, 195, 199, 195, 200, + 195, 99, 99, 99, 99, 99, 99, 546, 355, 112, + 113, 712, 195, 195, 114, 203, 653, 355, 203, 224, + 224, 224, 202, 692, 201, 195, 196, 99, 196, 195, + 195, 195, 195, 195, 195, 195, 197, 195, 144, 195, + 199, 195, 200, 195, 112, 113, 99, 99, 99, 114, + 99, 99, 99, 737, 228, 195, 195, 202, 228, 355, + 213, 270, 734, 733, 213, 277, 806, 201, 227, 224, + 224, 224, 227, 144, 204, 205, 99, 205, 204, 204, + + 204, 204, 204, 204, 204, 206, 204, 207, 204, 208, + 204, 209, 204, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 204, 204, 207, 207, 207, 207, + 207, 207, 207, 207, 210, 207, 211, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 112, 113, + 112, 113, 721, 114, 355, 114, 224, 224, 224, 228, + 797, 212, 355, 212, 224, 224, 224, 224, 224, 224, + 224, 224, 224, 227, 490, 490, 490, 144, 745, 144, + 214, 215, 99, 215, 214, 214, 214, 214, 214, 214, + 214, 216, 214, 217, 214, 218, 214, 219, 214, 217, + + 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, + 214, 214, 217, 220, 217, 217, 217, 217, 217, 217, + 217, 217, 221, 217, 217, 217, 222, 217, 217, 217, + 217, 217, 217, 217, 112, 113, 112, 113, 233, 114, + 228, 114, 228, 228, 228, 228, 228, 223, 355, 223, + 720, 719, 270, 228, 227, 812, 227, 227, 227, 227, + 227, 355, 228, 144, 234, 144, 228, 227, 228, 235, + 242, 243, 236, 255, 242, 277, 227, 237, 244, 228, + 227, 228, 227, 247, 723, 245, 260, 355, 260, 355, + 271, 255, 718, 227, 355, 227, 355, 255, 373, 373, + + 373, 373, 373, 373, 713, 247, 380, 380, 380, 278, + 288, 247, 252, 355, 375, 244, 758, 375, 725, 282, + 355, 724, 382, 385, 385, 385, 227, 380, 380, 380, + 385, 385, 385, 376, 392, 392, 392, 355, 355, 387, + 242, 243, 726, 382, 803, 744, 387, 777, 244, 271, + 394, 239, 392, 392, 392, 245, 492, 492, 492, 383, + 398, 398, 398, 398, 398, 398, 355, 355, 394, 406, + 406, 406, 388, 406, 406, 406, 400, 355, 355, 400, + 412, 412, 412, 694, 756, 408, 412, 412, 412, 408, + 418, 418, 418, 418, 418, 418, 414, 355, 695, 395, + + 728, 739, 414, 355, 409, 355, 420, 779, 401, 420, + 425, 425, 425, 425, 425, 425, 373, 373, 373, 373, + 373, 373, 373, 373, 373, 717, 427, 729, 355, 427, + 355, 421, 375, 415, 355, 375, 742, 730, 375, 444, + 444, 444, 380, 380, 380, 722, 716, 428, 380, 380, + 380, 380, 380, 380, 445, 449, 449, 449, 382, 385, + 385, 385, 355, 755, 382, 759, 355, 382, 355, 443, + 450, 385, 385, 385, 355, 387, 385, 385, 385, 453, + 453, 453, 448, 392, 392, 392, 765, 387, 392, 392, + 392, 757, 387, 704, 454, 392, 392, 392, 772, 394, + + 456, 456, 456, 766, 394, 458, 458, 458, 398, 398, + 398, 394, 398, 398, 398, 457, 451, 398, 398, 398, + 459, 463, 463, 463, 400, 406, 406, 406, 400, 465, + 465, 465, 355, 400, 355, 355, 464, 406, 406, 406, + 455, 408, 355, 786, 466, 406, 406, 406, 468, 468, + 468, 846, 793, 408, 412, 412, 412, 412, 412, 412, + 355, 408, 460, 469, 412, 412, 412, 472, 472, 472, + 414, 784, 767, 414, 418, 418, 418, 418, 418, 418, + 414, 355, 473, 418, 418, 418, 476, 476, 476, 355, + 420, 785, 467, 420, 703, 478, 478, 478, 702, 420, + + 788, 477, 425, 425, 425, 425, 425, 425, 355, 470, + 479, 425, 425, 425, 483, 483, 483, 355, 427, 701, + 776, 427, 373, 373, 373, 355, 355, 427, 794, 474, + 484, 485, 444, 444, 444, 497, 497, 497, 375, 498, + 727, 743, 499, 500, 500, 500, 355, 445, 700, 355, + 480, 699, 816, 496, 380, 380, 380, 355, 501, 449, + 449, 449, 504, 504, 504, 847, 505, 798, 355, 506, + 382, 385, 385, 385, 450, 453, 453, 453, 509, 509, + 509, 355, 510, 355, 849, 511, 698, 387, 355, 817, + 454, 355, 807, 503, 392, 392, 392, 456, 456, 456, + + 513, 513, 513, 789, 514, 355, 914, 515, 697, 355, + 394, 355, 457, 355, 507, 458, 458, 458, 516, 516, + 516, 790, 517, 791, 808, 518, 398, 398, 398, 355, + 459, 835, 512, 463, 463, 463, 522, 522, 522, 355, + 523, 792, 400, 524, 465, 465, 465, 355, 464, 525, + 525, 525, 686, 526, 355, 850, 527, 519, 809, 466, + 406, 406, 406, 468, 468, 468, 529, 529, 529, 355, + 530, 685, 915, 531, 355, 818, 408, 355, 469, 412, + 412, 412, 472, 472, 472, 534, 534, 534, 810, 535, + 355, 950, 536, 355, 355, 414, 819, 473, 418, 418, + + 418, 476, 476, 476, 799, 528, 539, 539, 539, 355, + 540, 918, 355, 541, 420, 355, 477, 478, 478, 478, + 814, 542, 542, 542, 796, 543, 843, 532, 544, 550, + 550, 550, 479, 425, 425, 425, 483, 483, 483, 490, + 490, 490, 492, 492, 492, 537, 373, 373, 373, 427, + 355, 355, 484, 497, 497, 497, 824, 498, 684, 355, + 499, 800, 375, 500, 500, 500, 556, 556, 556, 801, + 557, 355, 545, 558, 380, 380, 380, 859, 501, 504, + 504, 504, 355, 505, 355, 547, 506, 385, 385, 385, + 382, 562, 562, 562, 805, 555, 683, 509, 509, 509, + + 355, 510, 355, 387, 511, 560, 563, 392, 392, 392, + 513, 513, 513, 862, 514, 355, 860, 515, 516, 516, + 516, 355, 517, 394, 355, 518, 561, 398, 398, 398, + 522, 522, 522, 820, 523, 896, 355, 524, 525, 525, + 525, 837, 526, 400, 355, 527, 831, 355, 564, 406, + 406, 406, 529, 529, 529, 863, 530, 355, 682, 531, + 412, 412, 412, 861, 827, 408, 570, 570, 570, 681, + 534, 534, 534, 355, 535, 866, 414, 536, 355, 565, + 828, 571, 572, 572, 572, 829, 355, 568, 355, 539, + 539, 539, 569, 540, 680, 830, 541, 355, 573, 542, + + 542, 542, 885, 543, 836, 679, 544, 575, 575, 575, + 579, 579, 579, 550, 550, 550, 581, 581, 581, 582, + 582, 582, 355, 576, 373, 373, 373, 556, 556, 556, + 585, 557, 590, 586, 558, 591, 587, 879, 592, 678, + 375, 677, 588, 589, 593, 594, 380, 380, 380, 385, + 385, 385, 562, 562, 562, 602, 602, 602, 584, 598, + 598, 598, 382, 599, 355, 387, 600, 563, 392, 392, + 392, 603, 604, 604, 604, 605, 605, 605, 406, 406, + 406, 355, 919, 597, 394, 412, 412, 412, 876, 355, + 606, 596, 676, 355, 408, 570, 570, 570, 609, 609, + + 609, 414, 610, 675, 601, 611, 572, 572, 572, 886, + 571, 612, 612, 612, 575, 575, 575, 579, 579, 579, + 867, 355, 573, 616, 616, 616, 613, 355, 355, 607, + 576, 355, 608, 581, 581, 581, 582, 582, 582, 618, + 618, 618, 633, 633, 633, 385, 385, 385, 355, 598, + 598, 598, 877, 599, 838, 619, 600, 844, 634, 663, + 897, 387, 636, 636, 636, 602, 602, 602, 604, 604, + 604, 605, 605, 605, 845, 638, 638, 638, 637, 639, + 355, 603, 640, 641, 641, 641, 606, 412, 412, 412, + 609, 609, 609, 355, 610, 355, 635, 611, 930, 642, + + 612, 612, 612, 414, 644, 644, 644, 662, 645, 661, + 658, 646, 647, 647, 647, 613, 616, 616, 616, 868, + 618, 618, 618, 633, 633, 633, 878, 355, 355, 664, + 664, 664, 636, 636, 636, 643, 619, 355, 355, 634, + 638, 638, 638, 887, 639, 665, 355, 640, 637, 641, + 641, 641, 412, 412, 412, 644, 644, 644, 355, 645, + 657, 880, 646, 869, 870, 642, 355, 355, 414, 674, + 674, 674, 664, 664, 664, 412, 412, 412, 674, 674, + 674, 883, 884, 1004, 871, 705, 705, 705, 665, 355, + 355, 414, 705, 705, 705, 355, 355, 666, 647, 647, + + 647, 706, 731, 731, 731, 738, 738, 738, 706, 687, + 740, 740, 740, 355, 355, 872, 873, 732, 484, 656, + 932, 355, 874, 751, 751, 751, 355, 355, 894, 667, + 668, 731, 731, 731, 738, 738, 738, 669, 670, 355, + 671, 746, 746, 746, 672, 747, 732, 484, 748, 355, + 355, 740, 740, 740, 746, 746, 746, 484, 747, 655, + 752, 748, 355, 654, 895, 355, 355, 355, 355, 355, + 484, 751, 751, 751, 768, 768, 768, 754, 482, 482, + 482, 482, 482, 482, 482, 482, 482, 355, 875, 482, + 355, 881, 482, 482, 482, 484, 482, 764, 651, 900, + + 902, 901, 355, 769, 769, 769, 355, 355, 482, 482, + 482, 482, 482, 482, 482, 482, 482, 482, 482, 355, + 355, 482, 888, 889, 482, 482, 482, 484, 482, 770, + 770, 770, 771, 771, 771, 912, 650, 355, 355, 355, + 482, 482, 778, 778, 778, 355, 882, 355, 355, 482, + 482, 482, 482, 482, 773, 482, 482, 482, 355, 1007, + 482, 355, 355, 482, 482, 482, 484, 482, 903, 904, + 905, 355, 649, 928, 768, 768, 768, 890, 891, 482, + 482, 482, 482, 482, 482, 482, 482, 482, 482, 773, + 355, 355, 482, 355, 355, 482, 482, 482, 484, 482, + + 780, 769, 769, 769, 770, 770, 770, 771, 771, 771, + 892, 482, 482, 778, 778, 778, 355, 355, 355, 929, + 355, 355, 906, 355, 802, 802, 802, 781, 355, 355, + 782, 632, 898, 783, 802, 802, 802, 899, 355, 787, + 355, 813, 813, 813, 355, 815, 815, 815, 355, 907, + 355, 821, 821, 821, 355, 631, 931, 355, 933, 908, + 811, 355, 813, 813, 813, 355, 822, 355, 355, 823, + 815, 815, 815, 355, 825, 909, 355, 826, 355, 916, + 821, 821, 821, 920, 832, 917, 355, 833, 839, 839, + 839, 840, 840, 840, 956, 355, 355, 841, 841, 841, + + 842, 842, 842, 355, 355, 936, 913, 355, 848, 848, + 848, 946, 355, 355, 355, 355, 355, 355, 839, 839, + 839, 957, 851, 355, 355, 852, 840, 840, 840, 921, + 853, 947, 922, 854, 355, 355, 841, 841, 841, 355, + 855, 958, 355, 856, 842, 842, 842, 355, 857, 355, + 923, 858, 355, 355, 848, 848, 848, 959, 864, 355, + 355, 865, 893, 893, 893, 893, 893, 893, 924, 910, + 355, 355, 911, 355, 925, 355, 355, 937, 355, 355, + 938, 355, 939, 355, 355, 355, 926, 355, 927, 355, + 934, 935, 355, 948, 949, 355, 355, 355, 355, 355, + + 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 355, 940, 951, 355, 954, 941, 960, 942, 955, + 943, 961, 944, 962, 963, 945, 966, 967, 952, 355, + 953, 355, 970, 355, 974, 964, 975, 976, 965, 968, + 355, 355, 969, 355, 355, 977, 978, 971, 979, 980, + 981, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 355, 988, 972, 989, 973, 355, 982, 355, 355, 983, + 355, 984, 355, 355, 355, 355, 986, 987, 355, 355, + 355, 355, 990, 355, 991, 355, 355, 355, 355, 985, + 992, 993, 994, 1004, 355, 995, 996, 997, 998, 355, + + 999, 1007, 355, 1002, 1003, 1000, 355, 355, 355, 355, + 355, 1005, 355, 355, 355, 355, 1006, 355, 1001, 1008, + 1018, 1018, 355, 355, 1033, 1019, 1019, 1019, 630, 1034, + 355, 355, 355, 1016, 355, 1017, 355, 1009, 1010, 1011, + 1012, 1020, 355, 1013, 1014, 1015, 1023, 1023, 1023, 355, + 355, 1025, 355, 1021, 1022, 355, 355, 355, 1039, 1026, + 627, 355, 1024, 1035, 1035, 1035, 1027, 1028, 355, 1029, + 355, 626, 1030, 1031, 1032, 1019, 1019, 1019, 1037, 1036, + 1023, 1023, 1023, 1039, 1040, 1038, 1040, 1041, 1041, 1042, + 355, 1020, 355, 355, 1042, 355, 1024, 355, 355, 355, + + 1045, 355, 1045, 355, 1035, 1035, 1035, 1043, 355, 355, + 355, 625, 1044, 355, 355, 1046, 1046, 1046, 355, 624, + 1036, 1048, 1048, 1048, 1050, 1050, 1050, 1052, 1052, 1052, + 1058, 1047, 1056, 1056, 1056, 1059, 621, 1049, 620, 1054, + 1051, 1055, 617, 1053, 1046, 1046, 1046, 1060, 1057, 1048, + 1048, 1048, 1050, 1050, 1050, 1052, 1052, 1052, 1060, 355, + 1047, 1056, 1056, 1056, 595, 1049, 583, 355, 1051, 580, + 574, 1053, 1061, 1061, 1061, 567, 566, 1057, 1061, 1061, + 1061, 559, 554, 553, 552, 551, 549, 548, 1062, 484, + 538, 533, 521, 520, 1062, 96, 96, 96, 96, 96, + + 96, 96, 97, 97, 97, 97, 97, 97, 97, 102, + 102, 102, 102, 102, 102, 102, 105, 105, 105, 105, + 105, 105, 105, 108, 108, 108, 108, 108, 108, 108, + 111, 111, 111, 111, 111, 111, 111, 118, 118, 118, + 118, 118, 118, 118, 122, 122, 122, 122, 122, 122, + 122, 127, 127, 127, 127, 127, 127, 127, 131, 131, + 131, 131, 131, 131, 131, 149, 149, 149, 149, 149, + 149, 149, 153, 153, 153, 153, 153, 153, 153, 175, + 175, 175, 175, 175, 175, 175, 189, 189, 189, 189, + 189, 189, 189, 198, 198, 198, 198, 198, 198, 198, + + 241, 241, 241, 508, 241, 249, 249, 249, 502, 249, + 257, 257, 257, 495, 257, 262, 262, 262, 494, 262, + 267, 267, 267, 493, 267, 273, 273, 273, 491, 273, + 280, 280, 280, 489, 280, 284, 284, 284, 488, 284, + 290, 290, 290, 487, 290, 295, 295, 295, 295, 295, + 486, 295, 315, 475, 315, 320, 471, 320, 324, 442, + 324, 329, 462, 329, 333, 461, 333, 339, 452, 339, + 343, 441, 343, 347, 447, 347, 352, 446, 352, 354, + 354, 354, 354, 354, 354, 354, 360, 440, 439, 360, + 374, 374, 374, 374, 374, 374, 381, 381, 381, 381, + + 381, 381, 386, 386, 386, 386, 386, 386, 393, 393, + 393, 393, 393, 393, 399, 399, 399, 399, 399, 399, + 407, 407, 407, 407, 407, 407, 413, 413, 413, 413, + 413, 413, 419, 419, 419, 419, 419, 419, 426, 426, + 426, 426, 426, 426, 482, 482, 482, 482, 482, 482, + 482, 760, 760, 760, 760, 760, 760, 760, 761, 761, + 761, 761, 761, 761, 761, 438, 437, 436, 435, 434, + 433, 432, 431, 430, 355, 424, 423, 422, 417, 416, + 411, 410, 405, 404, 403, 402, 397, 396, 391, 390, + 389, 384, 379, 378, 377, 372, 371, 370, 369, 368, + + 367, 366, 365, 364, 363, 362, 361, 358, 356, 355, + 353, 351, 350, 349, 310, 348, 346, 345, 344, 342, + 341, 340, 338, 337, 336, 335, 334, 332, 331, 330, + 328, 327, 326, 325, 323, 311, 322, 321, 318, 317, + 313, 316, 312, 309, 308, 307, 306, 305, 304, 299, + 296, 298, 294, 293, 292, 291, 289, 287, 286, 285, + 283, 281, 279, 276, 275, 274, 272, 269, 268, 266, + 264, 263, 261, 258, 256, 254, 251, 250, 248, 240, + 238, 232, 231, 232, 231, 230, 229, 1063, 95, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063 + } ; + +static yyconst short int yy_chk[3144] = + { 0, + 0, 3, 3, 3, 4, 4, 4, 5, 5, 5, + 6, 6, 6, 9, 763, 3, 10, 11, 4, 12, + 9, 5, 762, 10, 6, 7, 7, 7, 8, 8, + 8, 13, 13, 11, 357, 12, 13, 13, 357, 7, + 14, 14, 8, 225, 13, 14, 14, 15, 15, 233, + 15, 100, 15, 14, 16, 16, 225, 16, 578, 16, + 15, 17, 17, 18, 18, 100, 101, 16, 19, 19, + 19, 20, 20, 20, 23, 23, 23, 24, 24, 24, + 101, 234, 19, 587, 234, 20, 587, 578, 23, 233, + 17, 24, 18, 21, 21, 21, 21, 21, 21, 21, + + 21, 21, 21, 21, 21, 21, 245, 21, 21, 21, + 21, 21, 98, 98, 98, 99, 99, 99, 103, 103, + 103, 245, 692, 21, 21, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 628, 22, + 22, 22, 22, 22, 25, 25, 25, 26, 26, 26, + 27, 27, 27, 692, 104, 22, 22, 252, 25, 128, + 300, 26, 300, 139, 27, 28, 28, 28, 104, 125, + 125, 125, 628, 128, 132, 132, 132, 139, 252, 28, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, + 29, 29, 29, 29, 31, 31, 32, 32, 750, 31, + 123, 32, 33, 33, 33, 671, 133, 31, 143, 32, + 34, 34, 34, 133, 123, 143, 33, 136, 136, 136, + 133, 671, 143, 31, 34, 32, 35, 35, 35, 35, + 35, 35, 35, 35, 35, 35, 35, 35, 35, 123, + 35, 35, 35, 35, 35, 37, 37, 37, 38, 38, + 38, 39, 39, 39, 372, 243, 35, 35, 297, 37, + + 648, 577, 38, 243, 372, 39, 297, 577, 35, 36, + 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, + 36, 36, 648, 36, 36, 36, 36, 36, 40, 40, + 40, 41, 41, 41, 42, 42, 42, 546, 429, 36, + 36, 592, 40, 669, 592, 41, 546, 150, 42, 429, + 547, 36, 43, 43, 43, 44, 44, 44, 147, 147, + 147, 150, 154, 154, 154, 669, 43, 749, 547, 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, 45, 47, 47, 48, 48, 689, 47, + 161, 48, 49, 49, 49, 736, 155, 47, 165, 48, + 50, 50, 50, 155, 161, 165, 49, 158, 158, 158, + 155, 689, 165, 47, 50, 48, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 53, 53, 53, 54, 54, 54, 55, 55, 55, 56, + 56, 56, 615, 673, 53, 786, 667, 54, 773, 773, + 55, 786, 171, 56, 57, 57, 57, 58, 58, 58, + 59, 59, 59, 60, 60, 60, 171, 688, 57, 673, + 690, 58, 615, 668, 59, 667, 184, 60, 61, 61, + 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, + 184, 668, 61, 795, 690, 62, 688, 734, 63, 668, + 795, 64, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 67, 67, 67, 68, + 68, 68, 69, 69, 69, 70, 70, 70, 691, 822, + 67, 696, 695, 68, 721, 739, 69, 726, 199, 70, + 71, 71, 71, 72, 72, 72, 73, 73, 73, 74, + 74, 74, 199, 739, 71, 822, 696, 72, 691, 726, + 73, 695, 208, 74, 75, 75, 75, 76, 76, 76, + 168, 168, 168, 176, 176, 176, 208, 720, 75, 622, + + 693, 76, 77, 77, 77, 77, 77, 77, 77, 77, + 77, 77, 77, 77, 77, 481, 77, 77, 77, 77, + 77, 81, 81, 81, 82, 82, 82, 481, 670, 79, + 79, 693, 77, 77, 79, 81, 622, 722, 82, 181, + 181, 181, 79, 670, 77, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 78, 79, 78, + 78, 78, 78, 78, 80, 80, 87, 87, 87, 80, + 88, 88, 88, 722, 178, 78, 78, 80, 193, 797, + 87, 178, 718, 717, 88, 193, 797, 78, 178, 190, + 190, 190, 193, 80, 83, 83, 83, 83, 83, 83, + + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, + 83, 83, 83, 83, 83, 83, 83, 83, 85, 85, + 86, 86, 704, 85, 788, 86, 196, 196, 196, 218, + 788, 85, 730, 86, 205, 205, 205, 215, 215, 215, + 224, 224, 224, 218, 437, 437, 437, 85, 730, 86, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, + 89, 89, 89, 89, 91, 91, 92, 92, 114, 91, + 134, 92, 130, 156, 145, 177, 166, 91, 803, 92, + 702, 701, 177, 179, 134, 803, 130, 156, 145, 177, + 166, 708, 192, 91, 114, 92, 194, 179, 191, 114, + 130, 130, 114, 145, 166, 191, 192, 114, 130, 203, + 194, 213, 191, 134, 708, 130, 156, 710, 177, 694, + 179, 192, 700, 203, 709, 213, 744, 191, 315, 315, + + 315, 316, 316, 316, 694, 192, 320, 320, 320, 194, + 213, 191, 202, 711, 315, 203, 744, 316, 710, 202, + 729, 709, 320, 324, 324, 324, 202, 321, 321, 321, + 325, 325, 325, 316, 329, 329, 329, 765, 794, 324, + 202, 202, 711, 321, 794, 729, 325, 765, 202, 202, + 329, 202, 330, 330, 330, 202, 439, 439, 439, 321, + 333, 333, 333, 334, 334, 334, 742, 672, 330, 339, + 339, 339, 325, 340, 340, 340, 333, 713, 724, 334, + 343, 343, 343, 672, 742, 339, 344, 344, 344, 340, + 347, 347, 347, 348, 348, 348, 343, 767, 672, 330, + + 713, 724, 344, 727, 340, 714, 347, 767, 334, 348, + 352, 352, 352, 353, 353, 353, 373, 373, 373, 374, + 374, 374, 376, 376, 376, 698, 352, 714, 741, 353, + 707, 348, 373, 344, 745, 374, 727, 714, 376, 377, + 377, 377, 380, 380, 380, 707, 697, 353, 381, 381, + 381, 383, 383, 383, 377, 384, 384, 384, 380, 385, + 385, 385, 743, 741, 381, 745, 759, 383, 753, 376, + 384, 386, 386, 386, 752, 385, 388, 388, 388, 391, + 391, 391, 383, 392, 392, 392, 752, 386, 393, 393, + 393, 743, 388, 686, 391, 395, 395, 395, 759, 392, + + 396, 396, 396, 753, 393, 397, 397, 397, 398, 398, + 398, 395, 399, 399, 399, 396, 388, 401, 401, 401, + 397, 404, 404, 404, 398, 406, 406, 406, 399, 405, + 405, 405, 777, 401, 784, 834, 404, 407, 407, 407, + 395, 406, 772, 777, 405, 409, 409, 409, 411, 411, + 411, 834, 784, 407, 412, 412, 412, 413, 413, 413, + 754, 409, 401, 411, 415, 415, 415, 417, 417, 417, + 412, 772, 754, 413, 418, 418, 418, 419, 419, 419, + 415, 776, 417, 421, 421, 421, 423, 423, 423, 779, + 418, 776, 409, 419, 685, 424, 424, 424, 684, 421, + + 779, 423, 425, 425, 425, 426, 426, 426, 764, 415, + 424, 428, 428, 428, 430, 430, 430, 785, 425, 681, + 764, 426, 443, 443, 443, 712, 728, 428, 785, 421, + 430, 430, 444, 444, 444, 445, 445, 445, 443, 445, + 712, 728, 445, 446, 446, 446, 807, 444, 680, 835, + 428, 679, 807, 443, 448, 448, 448, 789, 446, 449, + 449, 449, 450, 450, 450, 835, 450, 789, 837, 450, + 448, 451, 451, 451, 449, 453, 453, 453, 454, 454, + 454, 798, 454, 808, 837, 454, 678, 451, 896, 808, + 453, 780, 798, 448, 455, 455, 455, 456, 456, 456, + + 457, 457, 457, 780, 457, 823, 896, 457, 675, 781, + 455, 782, 456, 799, 451, 458, 458, 458, 459, 459, + 459, 781, 459, 782, 799, 459, 460, 460, 460, 783, + 458, 823, 455, 463, 463, 463, 464, 464, 464, 838, + 464, 783, 460, 464, 465, 465, 465, 800, 463, 466, + 466, 466, 663, 466, 897, 838, 466, 460, 800, 465, + 467, 467, 467, 468, 468, 468, 469, 469, 469, 809, + 469, 662, 897, 469, 932, 809, 467, 801, 468, 470, + 470, 470, 472, 472, 472, 473, 473, 473, 801, 473, + 810, 932, 473, 900, 790, 470, 810, 472, 474, 474, + + 474, 476, 476, 476, 790, 467, 477, 477, 477, 805, + 477, 900, 787, 477, 474, 831, 476, 478, 478, 478, + 805, 479, 479, 479, 787, 479, 831, 470, 479, 489, + 489, 489, 478, 480, 480, 480, 483, 483, 483, 490, + 490, 490, 492, 492, 492, 474, 496, 496, 496, 480, + 814, 791, 483, 497, 497, 497, 814, 497, 661, 792, + 497, 791, 496, 500, 500, 500, 501, 501, 501, 792, + 501, 843, 480, 501, 503, 503, 503, 843, 500, 504, + 504, 504, 846, 504, 796, 483, 504, 507, 507, 507, + 503, 508, 508, 508, 796, 496, 660, 509, 509, 509, + + 844, 509, 879, 507, 509, 503, 508, 512, 512, 512, + 513, 513, 513, 846, 513, 825, 844, 513, 516, 516, + 516, 811, 516, 512, 847, 516, 507, 519, 519, 519, + 522, 522, 522, 811, 522, 879, 820, 522, 525, 525, + 525, 825, 525, 519, 849, 525, 820, 845, 512, 528, + 528, 528, 529, 529, 529, 847, 529, 816, 658, 529, + 532, 532, 532, 845, 816, 528, 533, 533, 533, 657, + 534, 534, 534, 817, 534, 849, 532, 534, 818, 519, + 817, 533, 537, 537, 537, 818, 868, 528, 819, 539, + 539, 539, 532, 539, 656, 819, 539, 824, 537, 542, + + 542, 542, 868, 542, 824, 655, 542, 545, 545, 545, + 549, 549, 549, 550, 550, 550, 552, 552, 552, 553, + 553, 553, 862, 545, 555, 555, 555, 556, 556, 556, + 557, 556, 558, 557, 556, 558, 557, 862, 558, 654, + 555, 653, 557, 557, 558, 558, 560, 560, 560, 561, + 561, 561, 562, 562, 562, 565, 565, 565, 555, 563, + 563, 563, 560, 563, 901, 561, 563, 562, 564, 564, + 564, 565, 566, 566, 566, 567, 567, 567, 568, 568, + 568, 859, 901, 561, 564, 569, 569, 569, 859, 850, + 567, 560, 651, 869, 568, 570, 570, 570, 571, 571, + + 571, 569, 571, 650, 564, 571, 572, 572, 572, 869, + 570, 574, 574, 574, 575, 575, 575, 579, 579, 579, + 850, 860, 572, 580, 580, 580, 574, 880, 826, 568, + 575, 832, 569, 581, 581, 581, 582, 582, 582, 584, + 584, 584, 596, 596, 596, 597, 597, 597, 833, 598, + 598, 598, 860, 598, 826, 584, 598, 832, 596, 631, + 880, 597, 601, 601, 601, 602, 602, 602, 604, 604, + 604, 605, 605, 605, 833, 606, 606, 606, 601, 606, + 912, 602, 606, 607, 607, 607, 605, 608, 608, 608, + 609, 609, 609, 851, 609, 861, 597, 609, 912, 607, + + 612, 612, 612, 608, 613, 613, 613, 630, 613, 629, + 627, 613, 614, 614, 614, 612, 616, 616, 616, 851, + 618, 618, 618, 633, 633, 633, 861, 870, 614, 635, + 635, 635, 636, 636, 636, 608, 618, 852, 853, 633, + 638, 638, 638, 870, 638, 635, 863, 638, 636, 641, + 641, 641, 643, 643, 643, 644, 644, 644, 854, 644, + 626, 863, 644, 852, 853, 641, 866, 867, 643, 649, + 649, 649, 664, 664, 664, 666, 666, 666, 674, 674, + 674, 866, 867, 986, 854, 687, 687, 687, 664, 855, + 856, 666, 705, 705, 705, 986, 857, 643, 647, 647, + + 647, 687, 715, 715, 715, 723, 723, 723, 705, 666, + 725, 725, 725, 877, 647, 855, 856, 715, 715, 625, + 914, 723, 857, 737, 737, 737, 725, 914, 877, 647, + 647, 731, 731, 731, 738, 738, 738, 647, 647, 737, + 647, 732, 732, 732, 647, 732, 731, 731, 732, 878, + 738, 740, 740, 740, 746, 746, 746, 732, 746, 624, + 738, 746, 858, 623, 878, 864, 883, 740, 884, 885, + 746, 751, 751, 751, 755, 755, 755, 740, 747, 747, + 747, 747, 747, 747, 747, 747, 747, 751, 858, 747, + 755, 864, 747, 747, 747, 747, 747, 751, 621, 883, + + 885, 884, 894, 756, 756, 756, 871, 872, 747, 747, + 748, 748, 748, 748, 748, 748, 748, 748, 748, 756, + 865, 748, 871, 872, 748, 748, 748, 748, 748, 757, + 757, 757, 758, 758, 758, 894, 620, 886, 887, 888, + 748, 748, 766, 766, 766, 757, 865, 910, 758, 760, + 760, 760, 760, 760, 760, 760, 760, 760, 766, 990, + 760, 873, 874, 760, 760, 760, 760, 760, 886, 887, + 888, 990, 617, 910, 768, 768, 768, 873, 874, 760, + 760, 761, 761, 761, 761, 761, 761, 761, 761, 761, + 768, 889, 761, 911, 875, 761, 761, 761, 761, 761, + + 768, 769, 769, 769, 770, 770, 770, 771, 771, 771, + 875, 761, 761, 778, 778, 778, 881, 769, 890, 911, + 770, 882, 889, 771, 793, 793, 793, 769, 891, 778, + 770, 595, 881, 771, 802, 802, 802, 882, 913, 778, + 793, 804, 804, 804, 892, 806, 806, 806, 898, 890, + 802, 812, 812, 812, 899, 594, 913, 804, 915, 891, + 802, 806, 813, 813, 813, 915, 813, 812, 902, 813, + 815, 815, 815, 895, 815, 892, 938, 815, 813, 898, + 821, 821, 821, 902, 821, 899, 815, 821, 827, 827, + 827, 828, 828, 828, 938, 928, 821, 829, 829, 829, + + 830, 830, 830, 939, 827, 918, 895, 828, 836, 836, + 836, 928, 918, 829, 903, 929, 830, 904, 839, 839, + 839, 939, 839, 940, 836, 839, 840, 840, 840, 903, + 840, 929, 904, 840, 839, 905, 841, 841, 841, 941, + 841, 940, 840, 841, 842, 842, 842, 920, 842, 921, + 905, 842, 841, 906, 848, 848, 848, 941, 848, 907, + 842, 848, 876, 876, 876, 893, 893, 893, 906, 893, + 848, 908, 893, 909, 907, 916, 917, 919, 876, 922, + 920, 893, 921, 923, 919, 924, 908, 925, 909, 926, + 916, 917, 927, 930, 931, 934, 933, 935, 936, 942, + + 930, 931, 937, 943, 946, 944, 945, 947, 950, 948, + 949, 951, 922, 933, 952, 936, 923, 942, 924, 937, + 925, 943, 926, 944, 945, 927, 948, 949, 934, 953, + 935, 954, 952, 955, 956, 946, 957, 958, 947, 950, + 966, 956, 951, 957, 958, 959, 960, 953, 961, 962, + 963, 964, 959, 960, 965, 961, 962, 963, 967, 968, + 969, 970, 954, 971, 955, 972, 964, 973, 970, 965, + 971, 966, 982, 974, 975, 976, 968, 969, 977, 978, + 979, 980, 972, 981, 973, 983, 984, 985, 992, 967, + 974, 975, 976, 987, 988, 977, 978, 979, 980, 989, + + 981, 991, 987, 984, 985, 982, 993, 994, 995, 996, + 991, 988, 997, 998, 999, 1000, 989, 1001, 983, 992, + 1002, 1003, 1005, 1006, 1016, 1004, 1004, 1004, 593, 1017, + 1003, 1016, 1002, 1000, 1008, 1001, 1017, 993, 994, 995, + 996, 1004, 1009, 997, 998, 999, 1007, 1007, 1007, 1010, + 1011, 1008, 1012, 1005, 1006, 1013, 1014, 1015, 1025, 1009, + 591, 1021, 1007, 1018, 1018, 1018, 1010, 1011, 1022, 1012, + 1025, 590, 1013, 1014, 1015, 1019, 1019, 1019, 1021, 1018, + 1023, 1023, 1023, 1026, 1028, 1022, 1027, 1029, 1030, 1031, + 1033, 1019, 1026, 1028, 1032, 1034, 1023, 1030, 1027, 1029, + + 1038, 1031, 1037, 1032, 1035, 1035, 1035, 1033, 1043, 1038, + 1044, 589, 1034, 1054, 1037, 1039, 1039, 1039, 1055, 588, + 1035, 1040, 1040, 1040, 1041, 1041, 1041, 1042, 1042, 1042, + 1054, 1039, 1045, 1045, 1045, 1055, 586, 1040, 585, 1043, + 1041, 1044, 583, 1042, 1046, 1046, 1046, 1058, 1045, 1048, + 1048, 1048, 1050, 1050, 1050, 1052, 1052, 1052, 1059, 1058, + 1046, 1056, 1056, 1056, 559, 1048, 554, 1059, 1050, 551, + 538, 1052, 1060, 1060, 1060, 521, 520, 1056, 1061, 1061, + 1061, 502, 495, 494, 493, 491, 488, 485, 1060, 482, + 475, 471, 462, 461, 1061, 1064, 1064, 1064, 1064, 1064, + + 1064, 1064, 1065, 1065, 1065, 1065, 1065, 1065, 1065, 1066, + 1066, 1066, 1066, 1066, 1066, 1066, 1067, 1067, 1067, 1067, + 1067, 1067, 1067, 1068, 1068, 1068, 1068, 1068, 1068, 1068, + 1069, 1069, 1069, 1069, 1069, 1069, 1069, 1070, 1070, 1070, + 1070, 1070, 1070, 1070, 1071, 1071, 1071, 1071, 1071, 1071, + 1071, 1072, 1072, 1072, 1072, 1072, 1072, 1072, 1073, 1073, + 1073, 1073, 1073, 1073, 1073, 1074, 1074, 1074, 1074, 1074, + 1074, 1074, 1075, 1075, 1075, 1075, 1075, 1075, 1075, 1076, + 1076, 1076, 1076, 1076, 1076, 1076, 1077, 1077, 1077, 1077, + 1077, 1077, 1077, 1078, 1078, 1078, 1078, 1078, 1078, 1078, + + 1079, 1079, 1079, 452, 1079, 1080, 1080, 1080, 447, 1080, + 1081, 1081, 1081, 442, 1081, 1082, 1082, 1082, 441, 1082, + 1083, 1083, 1083, 440, 1083, 1084, 1084, 1084, 438, 1084, + 1085, 1085, 1085, 436, 1085, 1086, 1086, 1086, 435, 1086, + 1087, 1087, 1087, 434, 1087, 1088, 1088, 1088, 1088, 1088, + 433, 1088, 1089, 422, 1089, 1090, 416, 1090, 1091, 410, + 1091, 1092, 403, 1092, 1093, 402, 1093, 1094, 390, 1094, + 1095, 389, 1095, 1096, 379, 1096, 1097, 378, 1097, 1098, + 1098, 1098, 1098, 1098, 1098, 1098, 1099, 371, 370, 1099, + 1100, 1100, 1100, 1100, 1100, 1100, 1101, 1101, 1101, 1101, + + 1101, 1101, 1102, 1102, 1102, 1102, 1102, 1102, 1103, 1103, + 1103, 1103, 1103, 1103, 1104, 1104, 1104, 1104, 1104, 1104, + 1105, 1105, 1105, 1105, 1105, 1105, 1106, 1106, 1106, 1106, + 1106, 1106, 1107, 1107, 1107, 1107, 1107, 1107, 1108, 1108, + 1108, 1108, 1108, 1108, 1109, 1109, 1109, 1109, 1109, 1109, + 1109, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1111, 1111, + 1111, 1111, 1111, 1111, 1111, 369, 368, 367, 366, 365, + 362, 361, 360, 358, 354, 351, 350, 349, 346, 345, + 342, 341, 338, 337, 336, 335, 332, 331, 328, 327, + 326, 323, 319, 318, 317, 314, 313, 312, 311, 310, + + 309, 308, 306, 305, 304, 303, 302, 298, 296, 295, + 294, 293, 292, 291, 288, 287, 286, 285, 282, 281, + 278, 277, 276, 275, 274, 271, 270, 269, 268, 265, + 264, 263, 260, 259, 258, 255, 254, 253, 251, 250, + 247, 246, 244, 242, 239, 238, 237, 236, 235, 229, + 228, 226, 223, 222, 221, 220, 216, 212, 211, 210, + 206, 201, 197, 188, 187, 186, 182, 174, 173, 169, + 164, 163, 159, 152, 148, 144, 142, 141, 137, 126, + 121, 120, 119, 113, 112, 110, 107, 95, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, + 1063, 1063, 1063 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +/* 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 *yytext; +#line 1 "xmltree_read.l" +#define INITIAL 0 +/* Validating XML processor for octave.dtd. + * Generated 2004/01/31 22:27:54. + * + * This program was generated with the FleXML XML processor generator, + * (Id: flexml.pl,v 1.28 2003/02/12 02:55:41 krisrose Exp). + * Copyright © 1999 Kristoffer Rose. All rights reserved. + * + * You can redistribute and/or modify this program provided the following + * two conditions hold: + * + * 1. The program is distributed WITHOUT ANY WARRANTY from the author of + * FleXML; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * 2. The program distribution conditions do not in any way affect the + * distribution conditions of the FleXML system used to generate this + * file or any version of FleXML derived from that system. + * + * Notice that these are explicit rights granted to you for files + * generated by the FleXML system. For your rights in connection with + * the FleXML system itself please consult the GNU General Public License. + */ +#line 25 "xmltree_read.l" + +/* Version strings. */ +const char rcs_flexml_skeleton[] = + "$" "Id: skel,v 1.16 1999/12/09 04:01:51 krisrose Exp $"; +const char rcs_flexml[] = + "$" "Id: flexml.pl,v 1.28 2003/02/12 02:55:41 krisrose Exp $"; + +/* ANSI headers. */ +#include <unistd.h> +#include <stdio.h> +#include <string.h> +#include <assert.h> +#include <stdarg.h> +#include <ctype.h> + +/* Generated definitions. */ +#define FLEXML_BUFFERSTACKSIZE 100000 + +/* XML application entry points. */ +static void STag_octave(void); +static void ETag_octave(void); +static void STag_scalar(void); +static void ETag_scalar(void); +static void STag_complex(void); +static void ETag_complex(void); +static void STag_string(void); +static void ETag_string(void); +static void STag_array(void); +static void ETag_array(void); +static void STag_matrix(void); +static void ETag_matrix(void); +static void STag_structure(void); +static void ETag_structure(void); +static void STag_list(void); +static void ETag_list(void); +static void STag_cell(void); +static void ETag_cell(void); + +/* XML application data. */ +typedef char* AT_list_length; +#define AU_list_length NULL +typedef char* AT_matrix_rows; +#define AU_matrix_rows NULL +typedef char* AT_matrix_name; +#define AU_matrix_name NULL +typedef char* AT_cell_columns; +#define AU_cell_columns NULL +typedef char* AT_scalar_name; +#define AU_scalar_name NULL +typedef char* AT_array_name; +#define AU_array_name NULL +typedef char* AT_complex_name; +#define AU_complex_name NULL +typedef char* AT_matrix_columns; +#define AU_matrix_columns NULL +typedef char* AT_cell_name; +#define AU_cell_name NULL +typedef char* AT_string_length; +#define AU_string_length NULL +typedef char* AT_list_name; +#define AU_list_name NULL +typedef enum { AU_scalar_value, A_scalar_value_undefined,A_scalar_value_true,A_scalar_value_false,A_scalar_value_inf,A_scalar_value_neginf,A_scalar_value_na,A_scalar_value_nan } AT_scalar_value; +typedef char* AT_structure_name; +#define AU_structure_name NULL +typedef char* AT_cell_rows; +#define AU_cell_rows NULL +typedef char* AT_array_rows; +#define AU_array_rows NULL +typedef char* AT_string_name; +#define AU_string_name NULL + +/* FleXML-provided data. */ +static char* pcdata; +static AT_list_length A_list_length; +static AT_matrix_rows A_matrix_rows; +static AT_matrix_name A_matrix_name; +static AT_cell_columns A_cell_columns; +static AT_scalar_name A_scalar_name; +static AT_array_name A_array_name; +static AT_complex_name A_complex_name; +static AT_matrix_columns A_matrix_columns; +static AT_cell_name A_cell_name; +static AT_string_length A_string_length; +static AT_list_name A_list_name; +static AT_scalar_value A_scalar_value; +static AT_structure_name A_structure_name; +static AT_cell_rows A_cell_rows; +static AT_array_rows A_array_rows; +static AT_string_name A_string_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, char*); + static void debug_leave(void); + static void debug_set(int, char*); +#else +# define ENTER(state) (yy_push_state(state)) +# define LEAVE (yy_pop_state()) +# define SET(state) BEGIN(state) +#endif + +/* Generic actions. */ +#define SKIP /*skip*/ +#define SUCCEED return 0 + +#define FAIL return fail +static int fail(const char*, ...); + +/* Text buffer stack handling. */ +char bufferstack[FLEXML_BUFFERSTACKSIZE]; +char* limit = bufferstack + FLEXML_BUFFERSTACKSIZE; +typedef struct BufferLast_s { + struct BufferLast_s *old; char* saved; char new[1]; +} BufferLast; +BufferLast* last = (BufferLast*)0; +char* next = bufferstack; + +#define BUFFERSET(P) (P = next) +#define BUFFERPUTC(C) (assert(next<limit), *(next++) = (C)) +#define BUFFERDONE (BUFFERPUTC('\0')) + +#define BUFFERLITERAL(C,P) bufferliteral(C,&(P),yytext) +static void bufferliteral(char c, char** pp, char* text) +{ + char *s = strchr(text,c), *e = strrchr(text,c); + assert(s <= e); BUFFERSET(*pp); + while (++s<e) { + if (isspace(*s)) { BUFFERPUTC(' '); while (isspace(*s)) ++s; } + else BUFFERPUTC(*s); + } + BUFFERDONE; +} + +#ifdef FLEXML_HasMixed +static void pushbuffer(char* p) +{ + BufferLast* l = (BufferLast*)next; + assert(next < limit); + l->old = last; + l->saved = p; + next = l->new; + last = l; +} + +static char* popbuffer(void) +{ + BufferLast* l = last; + assert(last != (BufferLast*)0); + last = l->old; + next = (char*)l; + return l->saved; +} +#endif + +/* General internal entities are `unput' back onto the input stream... */ +#define ENTITYTEXT(T) \ + { char *s = (T), *e = s+strlen(s);\ + while (--e >= s) { unput(*e); }} +/* Flex standard options. */ +#define YY_STACK_USED 1 +#define YY_NO_TOP_STATE 1 +#define YY_NO_INPUT 1 +/* Flex user-requested options. */ +#define YY_NO_UNPUT 1 +/* 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 <?xml...> + * DOCTYPE the XML prolog of the document after <?xml...> + * 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 <![CDATA[...]]> section. + * ROOT_<tag> expect root element <tag> + * AL_<tag> inside the attribute list for <tag> + * IN_<tag> inside a <tag> with element contents (ready for end tag) + * IMPOSSIBLE dummy to permit disabling rules; must be last + */ +#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_octave 9 +#define AL_octave 10 +#define S_octave 11 +#define E_octave 12 + +#define ROOT_scalar 13 +#define AL_scalar 14 +#define IN_scalar 15 + +#define ROOT_complex 16 +#define AL_complex 17 +#define S_complex 18 +#define S_complex_1 19 +#define E_complex 20 + +#define ROOT_string 21 +#define AL_string 22 +#define IN_string 23 + +#define ROOT_array 24 +#define AL_array 25 +#define S_array 26 +#define S_array_1 27 +#define S_array_2 28 +#define S_array_3 29 +#define E_array 30 + +#define ROOT_matrix 31 +#define AL_matrix 32 +#define S_matrix 33 +#define S_matrix_1 34 +#define S_matrix_2 35 +#define E_matrix 36 + +#define ROOT_structure 37 +#define AL_structure 38 +#define IN_structure 39 + +#define ROOT_list 40 +#define AL_list 41 +#define IN_list 42 + +#define ROOT_cell 43 +#define AL_cell 44 +#define IN_cell 45 + +#define IMPOSSIBLE 46 + +#line 245 "xmltree_read.l" +/* State names. */ +char* statenames[IMPOSSIBLE]; + +void FleXML_init(void) +{ + statenames[PROLOG] = NULL; + statenames[DOCTYPE] = NULL; + statenames[EPILOG] = NULL; + statenames[INCOMMENT] = NULL; + statenames[INPI] = NULL; + statenames[VALUE1] = NULL; + statenames[VALUE2] = NULL; + statenames[CDATA] = NULL; + statenames[ROOT_octave] = NULL; + statenames[AL_octave] = NULL; + statenames[S_octave] = "octave"; + statenames[E_octave] = "octave"; + statenames[ROOT_scalar] = NULL; + statenames[AL_scalar] = NULL; + statenames[IN_scalar] = "scalar"; + statenames[ROOT_complex] = NULL; + statenames[AL_complex] = NULL; + statenames[S_complex] = "complex"; + statenames[S_complex_1] = "complex"; + statenames[E_complex] = "complex"; + statenames[ROOT_string] = NULL; + statenames[AL_string] = NULL; + statenames[IN_string] = "string"; + statenames[ROOT_array] = NULL; + statenames[AL_array] = NULL; + statenames[S_array] = "array"; + statenames[S_array_1] = "array"; + statenames[S_array_2] = "array"; + statenames[S_array_3] = "array"; + statenames[E_array] = "array"; + statenames[ROOT_matrix] = NULL; + statenames[AL_matrix] = NULL; + statenames[S_matrix] = "matrix"; + statenames[S_matrix_1] = "matrix"; + statenames[S_matrix_2] = "matrix"; + statenames[E_matrix] = "matrix"; + statenames[ROOT_structure] = NULL; + statenames[AL_structure] = NULL; + statenames[IN_structure] = "structure"; + statenames[ROOT_list] = NULL; + statenames[AL_list] = NULL; + statenames[IN_list] = "list"; + statenames[ROOT_cell] = NULL; + statenames[AL_cell] = NULL; + statenames[IN_cell] = "cell"; +} +#line 1748 "xmltree_read.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include <stdlib.h> +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* 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( yytext, yyleng, 1, yyout ) +#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->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + } +#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 + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * 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 + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 298 "xmltree_read.l" + + + /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ + SET(PROLOG); FleXML_init(); + + /* COMMENTS and PIs: handled uniformly for efficiency. */ + +#line 1918 "xmltree_read.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 ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *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 >= 1064 ) + 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_current_state != 1063 ); + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + + +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 306 "xmltree_read.l" +ENTER(INCOMMENT); + YY_BREAK +case 2: +YY_RULE_SETUP +#line 307 "xmltree_read.l" +ENTER(INPI); + YY_BREAK + + +case 3: +YY_RULE_SETUP +#line 310 "xmltree_read.l" +LEAVE; + YY_BREAK +case 4: +#line 312 "xmltree_read.l" +case 5: +#line 313 "xmltree_read.l" +case 6: +YY_RULE_SETUP +#line 313 "xmltree_read.l" +SKIP; + YY_BREAK +case YY_STATE_EOF(INCOMMENT): +#line 314 "xmltree_read.l" +FAIL("EOF in comment."); + YY_BREAK + + +case 7: +YY_RULE_SETUP +#line 317 "xmltree_read.l" +LEAVE; + YY_BREAK +case 8: +#line 319 "xmltree_read.l" +case 9: +YY_RULE_SETUP +#line 319 "xmltree_read.l" +SKIP; + YY_BREAK +case YY_STATE_EOF(INPI): +#line 320 "xmltree_read.l" +FAIL("EOF in PI (processing instruction)."); + YY_BREAK + +/* SPACES: skipped uniformly */ +case 10: +YY_RULE_SETUP +#line 325 "xmltree_read.l" +SKIP; + YY_BREAK +/* PROLOG: determine root element and process it. */ + +case 11: +YY_RULE_SETUP +#line 330 "xmltree_read.l" +SET(DOCTYPE); + YY_BREAK +case 12: +YY_RULE_SETUP +#line 331 "xmltree_read.l" +FAIL("Bad declaration %s.",yytext); + YY_BREAK + + +case 13: +YY_RULE_SETUP +#line 335 "xmltree_read.l" +SET(ROOT_scalar); + YY_BREAK +case 14: +YY_RULE_SETUP +#line 336 "xmltree_read.l" +SET(ROOT_octave); + YY_BREAK +case 15: +YY_RULE_SETUP +#line 337 "xmltree_read.l" +SET(ROOT_complex); + YY_BREAK +case 16: +YY_RULE_SETUP +#line 338 "xmltree_read.l" +SET(ROOT_string); + YY_BREAK +case 17: +YY_RULE_SETUP +#line 339 "xmltree_read.l" +SET(ROOT_matrix); + YY_BREAK +case 18: +YY_RULE_SETUP +#line 340 "xmltree_read.l" +SET(ROOT_array); + YY_BREAK +case 19: +YY_RULE_SETUP +#line 341 "xmltree_read.l" +SET(ROOT_structure); + YY_BREAK +case 20: +YY_RULE_SETUP +#line 342 "xmltree_read.l" +SET(ROOT_cell); + YY_BREAK +case 21: +YY_RULE_SETUP +#line 343 "xmltree_read.l" +SET(ROOT_list); + YY_BREAK +case 22: +YY_RULE_SETUP +#line 344 "xmltree_read.l" +FAIL("Bad declaration %s.",yytext); + YY_BREAK +case 23: +YY_RULE_SETUP +#line 345 "xmltree_read.l" +FAIL("Unexpected character `%c' in prolog.", yytext[0]); + YY_BREAK +case YY_STATE_EOF(PROLOG): +case YY_STATE_EOF(DOCTYPE): +#line 346 "xmltree_read.l" +FAIL("EOF in prolog."); + YY_BREAK + +/* RULES DERIVED FROM DTD. */ +case 24: +YY_RULE_SETUP +#line 351 "xmltree_read.l" +{ + ENTER(AL_octave); + } + YY_BREAK + +case 25: +YY_RULE_SETUP +#line 356 "xmltree_read.l" +{ + LEAVE; STag_octave(); pcdata = NULL; ENTER(S_octave); + } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 359 "xmltree_read.l" +FAIL("`octave' element cannot be empty."); + YY_BREAK +case 27: +YY_RULE_SETUP +#line 360 "xmltree_read.l" +FAIL("Unexpected character `%c' in attribute list of octave element.", yytext[0]); + YY_BREAK +case 28: +YY_RULE_SETUP +#line 361 "xmltree_read.l" +FAIL("Bad attribute `%s' in `octave' element start tag.",yytext); + YY_BREAK +case YY_STATE_EOF(AL_octave): +#line 362 "xmltree_read.l" +FAIL("EOF in attribute list of `octave' element."); + YY_BREAK + + +case 29: +YY_RULE_SETUP +#line 366 "xmltree_read.l" +{ + LEAVE; + ETag_octave(); + switch (YY_START) { + case ROOT_octave: SET(EPILOG); break; + } + } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 373 "xmltree_read.l" +FAIL("Unexpected end-tag `%s': `</octave>' expected.",yytext); + YY_BREAK +case 31: +YY_RULE_SETUP +#line 374 "xmltree_read.l" +FAIL("Unexpected character `%c': `</octave>' expected.",yytext[0]); + YY_BREAK +case YY_STATE_EOF(E_octave): +#line 375 "xmltree_read.l" +FAIL("Premature EOF: `</octave>' expected."); + YY_BREAK + +/* value (undefined | true | false | inf | neginf | na | nan) "undefined" + * name CDATA #IMPLIED> */ +case 32: +YY_RULE_SETUP +#line 381 "xmltree_read.l" +{ + A_scalar_value = A_scalar_value_undefined; + A_scalar_name = NULL; + ENTER(AL_scalar); + } + YY_BREAK + +case 33: +#line 389 "xmltree_read.l" +case 34: +YY_RULE_SETUP +#line 389 "xmltree_read.l" +A_scalar_value = A_scalar_value_undefined; + YY_BREAK +case 35: +#line 391 "xmltree_read.l" +case 36: +YY_RULE_SETUP +#line 391 "xmltree_read.l" +A_scalar_value = A_scalar_value_true; + YY_BREAK +case 37: +#line 393 "xmltree_read.l" +case 38: +YY_RULE_SETUP +#line 393 "xmltree_read.l" +A_scalar_value = A_scalar_value_false; + YY_BREAK +case 39: +#line 395 "xmltree_read.l" +case 40: +YY_RULE_SETUP +#line 395 "xmltree_read.l" +A_scalar_value = A_scalar_value_inf; + YY_BREAK +case 41: +#line 397 "xmltree_read.l" +case 42: +YY_RULE_SETUP +#line 397 "xmltree_read.l" +A_scalar_value = A_scalar_value_neginf; + YY_BREAK +case 43: +#line 399 "xmltree_read.l" +case 44: +YY_RULE_SETUP +#line 399 "xmltree_read.l" +A_scalar_value = A_scalar_value_na; + YY_BREAK +case 45: +#line 401 "xmltree_read.l" +case 46: +YY_RULE_SETUP +#line 401 "xmltree_read.l" +A_scalar_value = A_scalar_value_nan; + YY_BREAK +case 47: +YY_RULE_SETUP +#line 403 "xmltree_read.l" +ENTER(VALUE1); BUFFERSET(A_scalar_name); + YY_BREAK +case 48: +YY_RULE_SETUP +#line 404 "xmltree_read.l" +ENTER(VALUE2); BUFFERSET(A_scalar_name); + YY_BREAK +case 49: +YY_RULE_SETUP +#line 406 "xmltree_read.l" +{ + LEAVE; STag_scalar(); pcdata = BUFFERSET(pcdata); ENTER(IN_scalar); + } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 409 "xmltree_read.l" +{ + LEAVE; STag_scalar(); pcdata = ""; ETag_scalar(); + switch (YY_START) { + case S_complex_1: SET(E_complex); break; + case S_octave: SET(E_octave); break; + case S_complex: SET(S_complex_1); break; + case S_matrix_1: case S_matrix: case S_matrix_2: SET(S_matrix_2); break; + case ROOT_scalar: SET(EPILOG); break; + } + } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 419 "xmltree_read.l" +FAIL("Unexpected character `%c' in attribute list of scalar element.", yytext[0]); + YY_BREAK +case 52: +YY_RULE_SETUP +#line 420 "xmltree_read.l" +FAIL("Bad attribute `%s' in `scalar' element start tag.",yytext); + YY_BREAK +case YY_STATE_EOF(AL_scalar): +#line 421 "xmltree_read.l" +FAIL("EOF in attribute list of `scalar' element."); + YY_BREAK + + +case 53: +YY_RULE_SETUP +#line 425 "xmltree_read.l" +{ + LEAVE; + BUFFERDONE; + ETag_scalar(); + switch (YY_START) { + case S_complex_1: SET(E_complex); break; + case S_octave: SET(E_octave); break; + case S_complex: SET(S_complex_1); break; + case S_matrix_1: case S_matrix: case S_matrix_2: SET(S_matrix_2); break; + case ROOT_scalar: SET(EPILOG); break; + } + } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 437 "xmltree_read.l" +FAIL("Unexpected end-tag `%s': `</scalar>' expected.",yytext); + YY_BREAK +case YY_STATE_EOF(IN_scalar): +#line 438 "xmltree_read.l" +FAIL("Premature EOF: `</scalar>' expected."); + YY_BREAK + +case 55: +YY_RULE_SETUP +#line 441 "xmltree_read.l" +{ + A_complex_name = NULL; + ENTER(AL_complex); + } + YY_BREAK + +case 56: +YY_RULE_SETUP +#line 447 "xmltree_read.l" +ENTER(VALUE1); BUFFERSET(A_complex_name); + YY_BREAK +case 57: +YY_RULE_SETUP +#line 448 "xmltree_read.l" +ENTER(VALUE2); BUFFERSET(A_complex_name); + YY_BREAK +case 58: +YY_RULE_SETUP +#line 450 "xmltree_read.l" +{ + LEAVE; STag_complex(); pcdata = NULL; ENTER(S_complex); + } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 453 "xmltree_read.l" +FAIL("`complex' element cannot be empty."); + YY_BREAK +case 60: +YY_RULE_SETUP +#line 454 "xmltree_read.l" +FAIL("Unexpected character `%c' in attribute list of complex element.", yytext[0]); + YY_BREAK +case 61: +YY_RULE_SETUP +#line 455 "xmltree_read.l" +FAIL("Bad attribute `%s' in `complex' element start tag.",yytext); + YY_BREAK +case YY_STATE_EOF(AL_complex): +#line 456 "xmltree_read.l" +FAIL("EOF in attribute list of `complex' element."); + YY_BREAK + + +case 62: +YY_RULE_SETUP +#line 460 "xmltree_read.l" +{ + LEAVE; + ETag_complex(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case S_matrix_1: case S_matrix: case S_matrix_2: SET(S_matrix_2); break; + case ROOT_complex: SET(EPILOG); break; + } + } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 469 "xmltree_read.l" +FAIL("Unexpected end-tag `%s': `</complex>' expected.",yytext); + YY_BREAK +case 64: +YY_RULE_SETUP +#line 470 "xmltree_read.l" +FAIL("Unexpected character `%c': `</complex>' expected.",yytext[0]); + YY_BREAK +case YY_STATE_EOF(E_complex): +#line 471 "xmltree_read.l" +FAIL("Premature EOF: `</complex>' expected."); + YY_BREAK + +/* length CDATA #REQUIRED + * name CDATA #IMPLIED> */ +case 65: +YY_RULE_SETUP +#line 477 "xmltree_read.l" +{ + A_string_length = NULL; + A_string_name = NULL; + ENTER(AL_string); + } + YY_BREAK + +case 66: +YY_RULE_SETUP +#line 484 "xmltree_read.l" +ENTER(VALUE1); BUFFERSET(A_string_length); + YY_BREAK +case 67: +YY_RULE_SETUP +#line 485 "xmltree_read.l" +ENTER(VALUE2); BUFFERSET(A_string_length); + YY_BREAK +case 68: +YY_RULE_SETUP +#line 487 "xmltree_read.l" +ENTER(VALUE1); BUFFERSET(A_string_name); + YY_BREAK +case 69: +YY_RULE_SETUP +#line 488 "xmltree_read.l" +ENTER(VALUE2); BUFFERSET(A_string_name); + YY_BREAK +case 70: +YY_RULE_SETUP +#line 490 "xmltree_read.l" +{ + if (!A_string_length) FAIL("Required attribute `length' not set for `string' element."); + LEAVE; STag_string(); pcdata = BUFFERSET(pcdata); ENTER(IN_string); + } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 494 "xmltree_read.l" +{ + if (!A_string_length) FAIL("Required attribute `length' not set for `string' element."); + LEAVE; STag_string(); pcdata = ""; ETag_string(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case S_array_2: case S_array_3: case S_array_1: SET(S_array_3); break; + case ROOT_string: SET(EPILOG); break; + case S_array: SET(S_array_1); break; + } + } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 504 "xmltree_read.l" +FAIL("Unexpected character `%c' in attribute list of string element.", yytext[0]); + YY_BREAK +case 73: +YY_RULE_SETUP +#line 505 "xmltree_read.l" +FAIL("Bad attribute `%s' in `string' element start tag.",yytext); + YY_BREAK +case YY_STATE_EOF(AL_string): +#line 506 "xmltree_read.l" +FAIL("EOF in attribute list of `string' element."); + YY_BREAK + + +case 74: +YY_RULE_SETUP +#line 510 "xmltree_read.l" +{ + LEAVE; + BUFFERDONE; + ETag_string(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case S_array_2: case S_array_3: case S_array_1: SET(S_array_3); break; + case ROOT_string: SET(EPILOG); break; + case S_array: SET(S_array_1); break; + } + } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 521 "xmltree_read.l" +FAIL("Unexpected end-tag `%s': `</string>' expected.",yytext); + YY_BREAK +case YY_STATE_EOF(IN_string): +#line 522 "xmltree_read.l" +FAIL("Premature EOF: `</string>' expected."); + YY_BREAK + +/* rows CDATA #REQUIRED + * name CDATA #IMPLIED> */ +case 76: +YY_RULE_SETUP +#line 528 "xmltree_read.l" +{ + A_array_rows = NULL; + A_array_name = NULL; + ENTER(AL_array); + } + YY_BREAK + +case 77: +YY_RULE_SETUP +#line 535 "xmltree_read.l" +ENTER(VALUE1); BUFFERSET(A_array_rows); + YY_BREAK +case 78: +YY_RULE_SETUP +#line 536 "xmltree_read.l" +ENTER(VALUE2); BUFFERSET(A_array_rows); + YY_BREAK +case 79: +YY_RULE_SETUP +#line 538 "xmltree_read.l" +ENTER(VALUE1); BUFFERSET(A_array_name); + YY_BREAK +case 80: +YY_RULE_SETUP +#line 539 "xmltree_read.l" +ENTER(VALUE2); BUFFERSET(A_array_name); + YY_BREAK +case 81: +YY_RULE_SETUP +#line 541 "xmltree_read.l" +{ + if (!A_array_rows) FAIL("Required attribute `rows' not set for `array' element."); + LEAVE; STag_array(); pcdata = NULL; ENTER(S_array); + } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 545 "xmltree_read.l" +FAIL("`array' element cannot be empty."); + YY_BREAK +case 83: +YY_RULE_SETUP +#line 546 "xmltree_read.l" +FAIL("Unexpected character `%c' in attribute list of array element.", yytext[0]); + YY_BREAK +case 84: +YY_RULE_SETUP +#line 547 "xmltree_read.l" +FAIL("Bad attribute `%s' in `array' element start tag.",yytext); + YY_BREAK +case YY_STATE_EOF(AL_array): +#line 548 "xmltree_read.l" +FAIL("EOF in attribute list of `array' element."); + YY_BREAK + + +case 85: +YY_RULE_SETUP +#line 552 "xmltree_read.l" +{ + LEAVE; + ETag_array(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case ROOT_array: SET(EPILOG); break; + } + } + YY_BREAK +case 86: +YY_RULE_SETUP +#line 560 "xmltree_read.l" +FAIL("Unexpected end-tag `%s': `</array>' expected.",yytext); + YY_BREAK +case 87: +YY_RULE_SETUP +#line 561 "xmltree_read.l" +FAIL("Unexpected character `%c': `</array>' expected.",yytext[0]); + YY_BREAK +case YY_STATE_EOF(S_array_3): +case YY_STATE_EOF(E_array): +#line 562 "xmltree_read.l" +FAIL("Premature EOF: `</array>' expected."); + YY_BREAK + +/* rows CDATA #REQUIRED + * columns CDATA #REQUIRED + * name CDATA #IMPLIED> */ +case 88: +YY_RULE_SETUP +#line 569 "xmltree_read.l" +{ + A_matrix_rows = NULL; + A_matrix_columns = NULL; + A_matrix_name = NULL; + ENTER(AL_matrix); + } + YY_BREAK + +case 89: +YY_RULE_SETUP +#line 577 "xmltree_read.l" +ENTER(VALUE1); BUFFERSET(A_matrix_rows); + YY_BREAK +case 90: +YY_RULE_SETUP +#line 578 "xmltree_read.l" +ENTER(VALUE2); BUFFERSET(A_matrix_rows); + YY_BREAK +case 91: +YY_RULE_SETUP +#line 580 "xmltree_read.l" +ENTER(VALUE1); BUFFERSET(A_matrix_columns); + YY_BREAK +case 92: +YY_RULE_SETUP +#line 581 "xmltree_read.l" +ENTER(VALUE2); BUFFERSET(A_matrix_columns); + YY_BREAK +case 93: +YY_RULE_SETUP +#line 583 "xmltree_read.l" +ENTER(VALUE1); BUFFERSET(A_matrix_name); + YY_BREAK +case 94: +YY_RULE_SETUP +#line 584 "xmltree_read.l" +ENTER(VALUE2); BUFFERSET(A_matrix_name); + YY_BREAK +case 95: +YY_RULE_SETUP +#line 586 "xmltree_read.l" +{ + if (!A_matrix_rows) FAIL("Required attribute `rows' not set for `matrix' element."); + if (!A_matrix_columns) FAIL("Required attribute `columns' not set for `matrix' element."); + LEAVE; STag_matrix(); pcdata = NULL; ENTER(S_matrix); + } + YY_BREAK +case 96: +YY_RULE_SETUP +#line 591 "xmltree_read.l" +{ + if (!A_matrix_rows) FAIL("Required attribute `rows' not set for `matrix' element."); + if (!A_matrix_columns) FAIL("Required attribute `columns' not set for `matrix' element."); + LEAVE; STag_matrix(); pcdata = NULL; ETag_matrix(); + switch (YY_START) { + case ROOT_matrix: SET(EPILOG); break; + } + } + YY_BREAK +case 97: +YY_RULE_SETUP +#line 599 "xmltree_read.l" +FAIL("Unexpected character `%c' in attribute list of matrix element.", yytext[0]); + YY_BREAK +case 98: +YY_RULE_SETUP +#line 600 "xmltree_read.l" +FAIL("Bad attribute `%s' in `matrix' element start tag.",yytext); + YY_BREAK +case YY_STATE_EOF(AL_matrix): +#line 601 "xmltree_read.l" +FAIL("EOF in attribute list of `matrix' element."); + YY_BREAK + + +case 99: +YY_RULE_SETUP +#line 605 "xmltree_read.l" +{ + LEAVE; + ETag_matrix(); + switch (YY_START) { + case ROOT_matrix: SET(EPILOG); break; + } + } + YY_BREAK +case 100: +YY_RULE_SETUP +#line 612 "xmltree_read.l" +FAIL("Unexpected end-tag `%s': `</matrix>' expected.",yytext); + YY_BREAK +case 101: +YY_RULE_SETUP +#line 613 "xmltree_read.l" +FAIL("Unexpected character `%c': `</matrix>' expected.",yytext[0]); + YY_BREAK +case YY_STATE_EOF(S_matrix): +case YY_STATE_EOF(S_matrix_2): +case YY_STATE_EOF(E_matrix): +#line 614 "xmltree_read.l" +FAIL("Premature EOF: `</matrix>' expected."); + YY_BREAK + +case 102: +YY_RULE_SETUP +#line 617 "xmltree_read.l" +{ + A_structure_name = NULL; + ENTER(AL_structure); + } + YY_BREAK + +case 103: +YY_RULE_SETUP +#line 623 "xmltree_read.l" +ENTER(VALUE1); BUFFERSET(A_structure_name); + YY_BREAK +case 104: +YY_RULE_SETUP +#line 624 "xmltree_read.l" +ENTER(VALUE2); BUFFERSET(A_structure_name); + YY_BREAK +case 105: +YY_RULE_SETUP +#line 626 "xmltree_read.l" +{ + LEAVE; STag_structure(); pcdata = BUFFERSET(pcdata); ENTER(IN_structure); + } + YY_BREAK +case 106: +YY_RULE_SETUP +#line 629 "xmltree_read.l" +{ + LEAVE; STag_structure(); pcdata = ""; ETag_structure(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case ROOT_structure: SET(EPILOG); break; + } + } + YY_BREAK +case 107: +YY_RULE_SETUP +#line 636 "xmltree_read.l" +FAIL("Unexpected character `%c' in attribute list of structure element.", yytext[0]); + YY_BREAK +case 108: +YY_RULE_SETUP +#line 637 "xmltree_read.l" +FAIL("Bad attribute `%s' in `structure' element start tag.",yytext); + YY_BREAK +case YY_STATE_EOF(AL_structure): +#line 638 "xmltree_read.l" +FAIL("EOF in attribute list of `structure' element."); + YY_BREAK + + +case 109: +YY_RULE_SETUP +#line 642 "xmltree_read.l" +{ + LEAVE; + BUFFERDONE; + ETag_structure(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case ROOT_structure: SET(EPILOG); break; + } + } + YY_BREAK +case 110: +YY_RULE_SETUP +#line 651 "xmltree_read.l" +FAIL("Unexpected end-tag `%s': `</structure>' expected.",yytext); + YY_BREAK +case YY_STATE_EOF(IN_structure): +#line 652 "xmltree_read.l" +FAIL("Premature EOF: `</structure>' expected."); + YY_BREAK + +/* length CDATA #REQUIRED + * name CDATA #IMPLIED> */ +case 111: +YY_RULE_SETUP +#line 658 "xmltree_read.l" +{ + A_list_length = NULL; + A_list_name = NULL; + ENTER(AL_list); + } + YY_BREAK + +case 112: +YY_RULE_SETUP +#line 665 "xmltree_read.l" +ENTER(VALUE1); BUFFERSET(A_list_length); + YY_BREAK +case 113: +YY_RULE_SETUP +#line 666 "xmltree_read.l" +ENTER(VALUE2); BUFFERSET(A_list_length); + YY_BREAK +case 114: +YY_RULE_SETUP +#line 668 "xmltree_read.l" +ENTER(VALUE1); BUFFERSET(A_list_name); + YY_BREAK +case 115: +YY_RULE_SETUP +#line 669 "xmltree_read.l" +ENTER(VALUE2); BUFFERSET(A_list_name); + YY_BREAK +case 116: +YY_RULE_SETUP +#line 671 "xmltree_read.l" +{ + if (!A_list_length) FAIL("Required attribute `length' not set for `list' element."); + LEAVE; STag_list(); pcdata = BUFFERSET(pcdata); ENTER(IN_list); + } + YY_BREAK +case 117: +YY_RULE_SETUP +#line 675 "xmltree_read.l" +{ + if (!A_list_length) FAIL("Required attribute `length' not set for `list' element."); + LEAVE; STag_list(); pcdata = ""; ETag_list(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case ROOT_list: SET(EPILOG); break; + } + } + YY_BREAK +case 118: +YY_RULE_SETUP +#line 683 "xmltree_read.l" +FAIL("Unexpected character `%c' in attribute list of list element.", yytext[0]); + YY_BREAK +case 119: +YY_RULE_SETUP +#line 684 "xmltree_read.l" +FAIL("Bad attribute `%s' in `list' element start tag.",yytext); + YY_BREAK +case YY_STATE_EOF(AL_list): +#line 685 "xmltree_read.l" +FAIL("EOF in attribute list of `list' element."); + YY_BREAK + + +case 120: +YY_RULE_SETUP +#line 689 "xmltree_read.l" +{ + LEAVE; + BUFFERDONE; + ETag_list(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case ROOT_list: SET(EPILOG); break; + } + } + YY_BREAK +case 121: +YY_RULE_SETUP +#line 698 "xmltree_read.l" +FAIL("Unexpected end-tag `%s': `</list>' expected.",yytext); + YY_BREAK +case YY_STATE_EOF(IN_list): +#line 699 "xmltree_read.l" +FAIL("Premature EOF: `</list>' expected."); + YY_BREAK + +/* rows CDATA #REQUIRED + * columns CDATA #REQUIRED + * name CDATA #IMPLIED> */ +case 122: +YY_RULE_SETUP +#line 706 "xmltree_read.l" +{ + A_cell_rows = NULL; + A_cell_columns = NULL; + A_cell_name = NULL; + ENTER(AL_cell); + } + YY_BREAK + +case 123: +YY_RULE_SETUP +#line 714 "xmltree_read.l" +ENTER(VALUE1); BUFFERSET(A_cell_rows); + YY_BREAK +case 124: +YY_RULE_SETUP +#line 715 "xmltree_read.l" +ENTER(VALUE2); BUFFERSET(A_cell_rows); + YY_BREAK +case 125: +YY_RULE_SETUP +#line 717 "xmltree_read.l" +ENTER(VALUE1); BUFFERSET(A_cell_columns); + YY_BREAK +case 126: +YY_RULE_SETUP +#line 718 "xmltree_read.l" +ENTER(VALUE2); BUFFERSET(A_cell_columns); + YY_BREAK +case 127: +YY_RULE_SETUP +#line 720 "xmltree_read.l" +ENTER(VALUE1); BUFFERSET(A_cell_name); + YY_BREAK +case 128: +YY_RULE_SETUP +#line 721 "xmltree_read.l" +ENTER(VALUE2); BUFFERSET(A_cell_name); + YY_BREAK +case 129: +YY_RULE_SETUP +#line 723 "xmltree_read.l" +{ + if (!A_cell_rows) FAIL("Required attribute `rows' not set for `cell' element."); + if (!A_cell_columns) FAIL("Required attribute `columns' not set for `cell' element."); + LEAVE; STag_cell(); pcdata = BUFFERSET(pcdata); ENTER(IN_cell); + } + YY_BREAK +case 130: +YY_RULE_SETUP +#line 728 "xmltree_read.l" +{ + if (!A_cell_rows) FAIL("Required attribute `rows' not set for `cell' element."); + if (!A_cell_columns) FAIL("Required attribute `columns' not set for `cell' element."); + LEAVE; STag_cell(); pcdata = ""; ETag_cell(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case ROOT_cell: SET(EPILOG); break; + } + } + YY_BREAK +case 131: +YY_RULE_SETUP +#line 737 "xmltree_read.l" +FAIL("Unexpected character `%c' in attribute list of cell element.", yytext[0]); + YY_BREAK +case 132: +YY_RULE_SETUP +#line 738 "xmltree_read.l" +FAIL("Bad attribute `%s' in `cell' element start tag.",yytext); + YY_BREAK +case YY_STATE_EOF(AL_cell): +#line 739 "xmltree_read.l" +FAIL("EOF in attribute list of `cell' element."); + YY_BREAK + + +case 133: +YY_RULE_SETUP +#line 743 "xmltree_read.l" +{ + LEAVE; + BUFFERDONE; + ETag_cell(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case ROOT_cell: SET(EPILOG); break; + } + } + YY_BREAK +case 134: +YY_RULE_SETUP +#line 752 "xmltree_read.l" +FAIL("Unexpected end-tag `%s': `</cell>' expected.",yytext); + YY_BREAK +case YY_STATE_EOF(IN_cell): +#line 753 "xmltree_read.l" +FAIL("Premature EOF: `</cell>' expected."); + YY_BREAK + +/* EPILOG: after the root element. */ + +case 135: +YY_RULE_SETUP +#line 759 "xmltree_read.l" +FAIL("Unexpected character `%c' after document.", yytext[0]); + YY_BREAK +case YY_STATE_EOF(EPILOG): +#line 760 "xmltree_read.l" +SUCCEED; + YY_BREAK + +/* CHARACTER DATA. */ + +/* Non-defined standard entities... */ +case 136: +YY_RULE_SETUP +#line 767 "xmltree_read.l" +BUFFERPUTC('&'); + YY_BREAK +case 137: +YY_RULE_SETUP +#line 768 "xmltree_read.l" +BUFFERPUTC('<'); + YY_BREAK +case 138: +YY_RULE_SETUP +#line 769 "xmltree_read.l" +BUFFERPUTC('>'); + YY_BREAK +case 139: +YY_RULE_SETUP +#line 770 "xmltree_read.l" +BUFFERPUTC('\''); + YY_BREAK +case 140: +YY_RULE_SETUP +#line 771 "xmltree_read.l" +BUFFERPUTC('"'); + YY_BREAK +/* Character entities. */ +case 141: +YY_RULE_SETUP +#line 774 "xmltree_read.l" +BUFFERPUTC((unsigned char)atoi(yytext+2)); + YY_BREAK +case 142: +YY_RULE_SETUP +#line 775 "xmltree_read.l" +BUFFERPUTC((unsigned char)strtol(yytext+3,NULL,16)); + YY_BREAK + + +case 143: +#line 780 "xmltree_read.l" +case 144: +#line 781 "xmltree_read.l" +case 145: +#line 782 "xmltree_read.l" +case 146: +YY_RULE_SETUP +#line 782 "xmltree_read.l" +BUFFERPUTC('\n'); + YY_BREAK + + +case 147: +YY_RULE_SETUP +#line 786 "xmltree_read.l" +ENTER(CDATA); + YY_BREAK +case 148: +YY_RULE_SETUP +#line 787 "xmltree_read.l" +FAIL("Unexpected `]]>' in character data."); + YY_BREAK + + +case 149: +YY_RULE_SETUP +#line 791 "xmltree_read.l" +BUFFERDONE; LEAVE; + YY_BREAK +case YY_STATE_EOF(VALUE1): +#line 792 "xmltree_read.l" +FAIL("EOF in literal (\"'\" expected)."); + YY_BREAK + + +case 150: +YY_RULE_SETUP +#line 796 "xmltree_read.l" +BUFFERDONE; LEAVE; + YY_BREAK +case YY_STATE_EOF(VALUE2): +#line 797 "xmltree_read.l" +FAIL("EOF in literal (`\"' expected)."); + YY_BREAK + + +case 151: +YY_RULE_SETUP +#line 801 "xmltree_read.l" +BUFFERPUTC(yytext[0]); + YY_BREAK +case 152: +YY_RULE_SETUP +#line 802 "xmltree_read.l" +FAIL("Spurious `%c' in character data.",yytext[0]); + YY_BREAK + + +case 153: +YY_RULE_SETUP +#line 806 "xmltree_read.l" +LEAVE; + YY_BREAK +case 154: +YY_RULE_SETUP +#line 807 "xmltree_read.l" +BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]); + YY_BREAK +case 155: +YY_RULE_SETUP +#line 808 "xmltree_read.l" +BUFFERPUTC(yytext[0]); + YY_BREAK +case YY_STATE_EOF(CDATA): +#line 809 "xmltree_read.l" +FAIL("EOF in CDATA section."); + YY_BREAK + +/* Impossible rules to avoid warnings from flex(1). */ + +case 156: +YY_RULE_SETUP +#line 815 "xmltree_read.l" +FAIL("The Impossible Happened: INITIAL or IMPOSSIBLE state entered?"); + YY_BREAK + +case 157: +YY_RULE_SETUP +#line 818 "xmltree_read.l" +ECHO; + YY_BREAK +#line 3110 "xmltree_read.c" +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(ROOT_octave): +case YY_STATE_EOF(S_octave): +case YY_STATE_EOF(ROOT_scalar): +case YY_STATE_EOF(ROOT_complex): +case YY_STATE_EOF(S_complex): +case YY_STATE_EOF(S_complex_1): +case YY_STATE_EOF(ROOT_string): +case YY_STATE_EOF(ROOT_array): +case YY_STATE_EOF(S_array): +case YY_STATE_EOF(S_array_1): +case YY_STATE_EOF(S_array_2): +case YY_STATE_EOF(ROOT_matrix): +case YY_STATE_EOF(S_matrix_1): +case YY_STATE_EOF(ROOT_structure): +case YY_STATE_EOF(ROOT_list): +case YY_STATE_EOF(ROOT_cell): +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->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 yyin at a new source and called + * yylex(). 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->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->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->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_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, 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->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 yylex */ + + +/* 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() + { + register char *dest = yy_current_buffer->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->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->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->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->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* 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. */ + yy_flex_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->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->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; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->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() + { + 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 >= 1064 ) + 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 ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + 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 >= 1064 ) + 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 == 1063); + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#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->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. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + 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 yytext */ + yy_hold_char = *++yy_c_buf_p; + + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + 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->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_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 *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef _WIN32 +#include <unistd.h> +#else +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + 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 ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + 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) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_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; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + 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 *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_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; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + 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 *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_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); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (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 yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* 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 ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 818 "xmltree_read.l" + + +/* Element context stack lookup. */ +int element_context(int i) +{ + return (0<i && i<yy_start_stack_depth + ? yy_start_stack[yy_start_stack_ptr - i] + : 0); +} + +#ifdef FLEX_DEBUG +void print_yy_stack(char* fmt, ...) +{ + int i = 0; va_list ap; va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + for (i=1; i<yy_start_stack_ptr; i++) + fprintf(stderr, "%s/", statenames[yy_start_stack[i]]); + fprintf(stderr,"%s\n", statenames[YY_START]); + va_end(ap); +} + +static void debug_enter(int state, char* statename) { + yy_push_state(state); + if (yy_flex_debug) print_yy_stack("--ENTER(%s) : ",statename); +} + +static void debug_leave(void) { + if (yy_flex_debug) print_yy_stack("--LEAVE : "); + yy_pop_state(); +} + +static void debug_set(int state, char* statename) { + BEGIN(state); + if (yy_flex_debug) print_yy_stack("--SET(%s) : ",statename); +} +#endif + + +static int fail(const char* fmt, ...) +{ + va_list ap; va_start(ap, fmt); +#ifdef FLEXML_yylineno + fprintf(stderr, "Invalid XML (XML input line %d, state %d): ", yylineno, YY_START); +#else + fprintf(stderr, "Invalid XML (state %d): ",YY_START); +#endif + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); + return 1; +} + +#line 30 "xmltree_read.act" + +#include <stdlib.h> +#include "xmltree.h" + +#define warning perror + +element **current; +element *root; +list *lastlist; + +void STag_octave(void) +{ +#line 43 "xmltree_read.act" + +root = new_element(); +root->def_value = value_data; +current = &(root->child); + +lastlist = new_list(lastlist); +lastlist->root = current; + +} /* STag_octave */ + +void ETag_octave(void) +{ +#line 52 "xmltree_read.act" + +current = lastlist->root; +lastlist = pop_list(lastlist); +current = &((*current)->next); + +} /* ETag_octave */ + +void STag_scalar(void) +{ +#line 60 "xmltree_read.act" + +*current = new_element(); + +if (A_scalar_name) { + (*current)->name = (char *) malloc(strlen(A_scalar_name)+1); + strcpy ((*current)->name, A_scalar_name); +} + +(*current)->def_value = value_scalar; +switch (A_scalar_value) { + case A_scalar_value_true: (*current)->const_value = const_true; break; + case A_scalar_value_false: (*current)->const_value = const_false; break; + case A_scalar_value_inf: (*current)->const_value = const_inf; break; + case A_scalar_value_neginf: (*current)->const_value = const_neginf; break; + case A_scalar_value_nan: (*current)->const_value = const_nan; break; + case A_scalar_value_na: (*current)->const_value = const_na; break; + default: (*current)->const_value = const_undef; +} + +} /* STag_scalar */ + +void ETag_scalar(void) +{ +#line 80 "xmltree_read.act" + +if (((*current)->const_value == const_undef) && (pcdata)) + (*current)->scalar_value = strtod (pcdata, NULL); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); + +} /* ETag_scalar */ + +void STag_string(void) +{ +#line 91 "xmltree_read.act" + +*current = new_element(); + +if (A_string_name) { + (*current)->name = (char *) malloc(strlen(A_string_name)+1); + strcpy ((*current)->name, A_string_name); +} + +if (A_string_length) + (*current)->length = strtol (A_string_length, NULL, 10); + +(*current)->def_value = value_string; + +} /* STag_string */ + +void ETag_string(void) +{ +#line 105 "xmltree_read.act" + +if (pcdata) { + + int len = strlen(pcdata); + /* check length parameter */ + if ((*current)->length != len) { + warning("incorrect length parameter for string\n"); + (*current)->length = len; + } + + (*current)->string_value = (char *) malloc ((len+1) * sizeof(char)); + strcpy((*current)->string_value, pcdata); +} + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); + +} /* ETag_string */ + +void STag_complex(void) +{ +#line 126 "xmltree_read.act" + +*current = new_element(); + +if (A_complex_name) { + (*current)->name = (char *) malloc(strlen(A_complex_name)+1); + strcpy ((*current)->name, A_complex_name); +} + +(*current)->def_value = value_complex; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); + +} /* STag_complex */ + +void ETag_complex(void) +{ +#line 141 "xmltree_read.act" + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); + +} /* ETag_complex */ + +void STag_array(void) +{ +#line 152 "xmltree_read.act" + +*current = new_element(); + +if (A_array_name) { + (*current)->name = (char *) malloc(strlen(A_array_name)+1); + strcpy ((*current)->name, A_array_name); +} + +if (A_array_rows) + (*current)->rows = strtol (A_array_rows, NULL, 10); + +(*current)->def_value = value_array; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); + +} /* STag_array */ + +void ETag_array(void) +{ +#line 170 "xmltree_read.act" + +/* check rows parameter */ +if ((*(lastlist->root))->rows != (*(lastlist->root))->nb_elements) { + warning("incorrect length parameter for array\n"); + (*(lastlist->root))->rows = (*(lastlist->root))->nb_elements; +} + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); + +} /* ETag_array */ + +void STag_matrix(void) +{ +#line 187 "xmltree_read.act" + +*current = new_element(); + +if (A_matrix_name) { + (*current)->name = (char *) malloc(strlen(A_matrix_name)+1); + strcpy ((*current)->name, A_matrix_name); +} + +if (A_matrix_rows) + (*current)->rows = strtol (A_matrix_rows, NULL, 10); + +if (A_matrix_columns) + (*current)->columns = strtol (A_matrix_columns, NULL, 10); + +(*current)->def_value = value_matrix; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); + +} /* STag_matrix */ + +void ETag_matrix(void) +{ +#line 208 "xmltree_read.act" + +/* check (rows, columns) parameters */ +if ((*(lastlist->root))->rows * (*(lastlist->root))->columns != + (*(lastlist->root))->nb_elements) { + warning("incorrect (rows, columns) parameters for matrix: reshaping matrix into vector\n"); + (*(lastlist->root))->rows = 1; + (*(lastlist->root))->columns = (*(lastlist->root))->nb_elements; +} + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); + +} /* ETag_matrix */ + +void STag_structure(void) +{ +#line 227 "xmltree_read.act" + +*current = new_element(); + +if (A_structure_name) { + (*current)->name = (char *) malloc(strlen(A_structure_name)+1); + strcpy ((*current)->name, A_structure_name); +} + +(*current)->def_value = value_structure; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); + +} /* STag_structure */ + +void ETag_structure(void) +{ +#line 242 "xmltree_read.act" + +/* no check possible (sic) */ + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); + +} /* ETag_structure */ + +void STag_list(void) +{ +#line 255 "xmltree_read.act" + +*current = new_element(); + +if (A_list_name) { + (*current)->name = (char *) malloc(strlen(A_list_name)+1); + strcpy ((*current)->name, A_list_name); +} + +if (A_list_length) + (*current)->length = strtol (A_list_length, NULL, 10); + +(*current)->def_value = value_list; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); + +} /* STag_list */ + +void ETag_list(void) +{ +#line 273 "xmltree_read.act" + +/* check length parameter */ +if ((*(lastlist->root))->length != (*(lastlist->root))->nb_elements) { + warning("incorrect length parameter for list\n"); + (*(lastlist->root))->length = (*(lastlist->root))->nb_elements; +} + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); + +} /* ETag_list */ + +void STag_cell(void) +{ +#line 290 "xmltree_read.act" + +*current = new_element(); + +if (A_cell_name) { + (*current)->name = (char *) malloc(strlen(A_cell_name)+1); + strcpy ((*current)->name, A_cell_name); +} + +if (A_cell_rows) + (*current)->rows = strtol (A_cell_rows, NULL, 10); + +if (A_cell_columns) + (*current)->columns = strtol (A_cell_columns, NULL, 10); + +(*current)->def_value = value_cell; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); + +} /* STag_cell */ + +void ETag_cell(void) +{ +#line 311 "xmltree_read.act" + +/* check (rows, columns) parameters */ +if ((*(lastlist->root))->rows * (*(lastlist->root))->columns != + (*(lastlist->root))->nb_elements) { + warning("incorrect (rows, columns) parameters for cell: reshaping cell into list\n"); + (*(lastlist->root))->def_value = value_list; + (*(lastlist->root))->length = (*(lastlist->root))->nb_elements; +} + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); + +} /* ETag_cell */ + + +#line 346 "xmltree_read.act" + +element *read_xmltree (const char *file) { + + current = NULL; + root = NULL; + lastlist = NULL; + + yyin = fopen(file, "r"); + if (!yyin) + perror("can't open file\n"); + + yylex(); + fclose(yyin); + + return root; +} + + +/* XML application entry points. */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main/miscellaneous/xmltree_read.h Sat Jan 31 21:45:28 2004 +0000 @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2004 Laurent Mazet + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* 2004-01-28 + * initial release + */ + +#if !defined(__XMLTREE_READ_H__) +#define __XMLTREE_READ_H__ + +#include "xmltree.h" + +element *read_xmltree (const char *file); + +#endif /* __XMLTREE_READ_H__ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main/miscellaneous/xmltree_read.l Sat Jan 31 21:45:28 2004 +0000 @@ -0,0 +1,1242 @@ +/* Validating XML processor for octave.dtd. + * Generated 2004/01/31 22:27:54. + * + * This program was generated with the FleXML XML processor generator, + * (Id: flexml.pl,v 1.28 2003/02/12 02:55:41 krisrose Exp). + * Copyright © 1999 Kristoffer Rose. All rights reserved. + * + * You can redistribute and/or modify this program provided the following + * two conditions hold: + * + * 1. The program is distributed WITHOUT ANY WARRANTY from the author of + * FleXML; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. + * + * 2. The program distribution conditions do not in any way affect the + * distribution conditions of the FleXML system used to generate this + * file or any version of FleXML derived from that system. + * + * Notice that these are explicit rights granted to you for files + * generated by the FleXML system. For your rights in connection with + * the FleXML system itself please consult the GNU General Public License. + */ + +%{ + +/* Version strings. */ +const char rcs_flexml_skeleton[] = + "$" "Id: skel,v 1.16 1999/12/09 04:01:51 krisrose Exp $"; +const char rcs_flexml[] = + "$" "Id: flexml.pl,v 1.28 2003/02/12 02:55:41 krisrose Exp $"; + +/* ANSI headers. */ +#include <unistd.h> +#include <stdio.h> +#include <string.h> +#include <assert.h> +#include <stdarg.h> +#include <ctype.h> + +/* Generated definitions. */ +#define FLEXML_BUFFERSTACKSIZE 100000 + +/* XML application entry points. */ +static void STag_octave(void); +static void ETag_octave(void); +static void STag_scalar(void); +static void ETag_scalar(void); +static void STag_complex(void); +static void ETag_complex(void); +static void STag_string(void); +static void ETag_string(void); +static void STag_array(void); +static void ETag_array(void); +static void STag_matrix(void); +static void ETag_matrix(void); +static void STag_structure(void); +static void ETag_structure(void); +static void STag_list(void); +static void ETag_list(void); +static void STag_cell(void); +static void ETag_cell(void); + +/* XML application data. */ +typedef char* AT_list_length; +#define AU_list_length NULL +typedef char* AT_matrix_rows; +#define AU_matrix_rows NULL +typedef char* AT_matrix_name; +#define AU_matrix_name NULL +typedef char* AT_cell_columns; +#define AU_cell_columns NULL +typedef char* AT_scalar_name; +#define AU_scalar_name NULL +typedef char* AT_array_name; +#define AU_array_name NULL +typedef char* AT_complex_name; +#define AU_complex_name NULL +typedef char* AT_matrix_columns; +#define AU_matrix_columns NULL +typedef char* AT_cell_name; +#define AU_cell_name NULL +typedef char* AT_string_length; +#define AU_string_length NULL +typedef char* AT_list_name; +#define AU_list_name NULL +typedef enum { AU_scalar_value, A_scalar_value_undefined,A_scalar_value_true,A_scalar_value_false,A_scalar_value_inf,A_scalar_value_neginf,A_scalar_value_na,A_scalar_value_nan } AT_scalar_value; +typedef char* AT_structure_name; +#define AU_structure_name NULL +typedef char* AT_cell_rows; +#define AU_cell_rows NULL +typedef char* AT_array_rows; +#define AU_array_rows NULL +typedef char* AT_string_name; +#define AU_string_name NULL + +/* FleXML-provided data. */ +static char* pcdata; +static AT_list_length A_list_length; +static AT_matrix_rows A_matrix_rows; +static AT_matrix_name A_matrix_name; +static AT_cell_columns A_cell_columns; +static AT_scalar_name A_scalar_name; +static AT_array_name A_array_name; +static AT_complex_name A_complex_name; +static AT_matrix_columns A_matrix_columns; +static AT_cell_name A_cell_name; +static AT_string_length A_string_length; +static AT_list_name A_list_name; +static AT_scalar_value A_scalar_value; +static AT_structure_name A_structure_name; +static AT_cell_rows A_cell_rows; +static AT_array_rows A_array_rows; +static AT_string_name A_string_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, char*); + static void debug_leave(void); + static void debug_set(int, char*); +#else +# define ENTER(state) (yy_push_state(state)) +# define LEAVE (yy_pop_state()) +# define SET(state) BEGIN(state) +#endif + +/* Generic actions. */ +#define SKIP /*skip*/ +#define SUCCEED return 0 + +#define FAIL return fail +static int fail(const char*, ...); + +/* Text buffer stack handling. */ +char bufferstack[FLEXML_BUFFERSTACKSIZE]; +char* limit = bufferstack + FLEXML_BUFFERSTACKSIZE; +typedef struct BufferLast_s { + struct BufferLast_s *old; char* saved; char new[1]; +} BufferLast; +BufferLast* last = (BufferLast*)0; +char* next = bufferstack; + +#define BUFFERSET(P) (P = next) +#define BUFFERPUTC(C) (assert(next<limit), *(next++) = (C)) +#define BUFFERDONE (BUFFERPUTC('\0')) + +#define BUFFERLITERAL(C,P) bufferliteral(C,&(P),yytext) +static void bufferliteral(char c, char** pp, char* text) +{ + char *s = strchr(text,c), *e = strrchr(text,c); + assert(s <= e); BUFFERSET(*pp); + while (++s<e) { + if (isspace(*s)) { BUFFERPUTC(' '); while (isspace(*s)) ++s; } + else BUFFERPUTC(*s); + } + BUFFERDONE; +} + +#ifdef FLEXML_HasMixed +static void pushbuffer(char* p) +{ + BufferLast* l = (BufferLast*)next; + assert(next < limit); + l->old = last; + l->saved = p; + next = l->new; + last = l; +} + +static char* popbuffer(void) +{ + BufferLast* l = last; + assert(last != (BufferLast*)0); + last = l->old; + next = (char*)l; + return l->saved; +} +#endif + +/* General internal entities are `unput' back onto the input stream... */ +#define ENTITYTEXT(T) \ + { char *s = (T), *e = s+strlen(s);\ + while (--e >= s) { unput(*e); }} +%} + +/* Flex standard options. */ +%option stack +%option noyy_top_state +%option noinput +%option noreject +%option noyymore +%option noyywrap + +/* Flex user-requested options. */ +%option 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 <?xml...> + * DOCTYPE the XML prolog of the document after <?xml...> + * 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 <![CDATA[...]]> section. + * ROOT_<tag> expect root element <tag> + * AL_<tag> inside the attribute list for <tag> + * IN_<tag> inside a <tag> 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_octave AL_octave S_octave E_octave +%x ROOT_scalar AL_scalar IN_scalar +%x ROOT_complex AL_complex S_complex S_complex_1 E_complex +%x ROOT_string AL_string IN_string +%x ROOT_array AL_array S_array S_array_1 S_array_2 S_array_3 E_array +%x ROOT_matrix AL_matrix S_matrix S_matrix_1 S_matrix_2 E_matrix +%x ROOT_structure AL_structure IN_structure +%x ROOT_list AL_list IN_list +%x ROOT_cell AL_cell IN_cell +%x IMPOSSIBLE + +%{ +/* State names. */ +char* statenames[IMPOSSIBLE]; + +void FleXML_init(void) +{ + statenames[PROLOG] = NULL; + statenames[DOCTYPE] = NULL; + statenames[EPILOG] = NULL; + statenames[INCOMMENT] = NULL; + statenames[INPI] = NULL; + statenames[VALUE1] = NULL; + statenames[VALUE2] = NULL; + statenames[CDATA] = NULL; + statenames[ROOT_octave] = NULL; + statenames[AL_octave] = NULL; + statenames[S_octave] = "octave"; + statenames[E_octave] = "octave"; + statenames[ROOT_scalar] = NULL; + statenames[AL_scalar] = NULL; + statenames[IN_scalar] = "scalar"; + statenames[ROOT_complex] = NULL; + statenames[AL_complex] = NULL; + statenames[S_complex] = "complex"; + statenames[S_complex_1] = "complex"; + statenames[E_complex] = "complex"; + statenames[ROOT_string] = NULL; + statenames[AL_string] = NULL; + statenames[IN_string] = "string"; + statenames[ROOT_array] = NULL; + statenames[AL_array] = NULL; + statenames[S_array] = "array"; + statenames[S_array_1] = "array"; + statenames[S_array_2] = "array"; + statenames[S_array_3] = "array"; + statenames[E_array] = "array"; + statenames[ROOT_matrix] = NULL; + statenames[AL_matrix] = NULL; + statenames[S_matrix] = "matrix"; + statenames[S_matrix_1] = "matrix"; + statenames[S_matrix_2] = "matrix"; + statenames[E_matrix] = "matrix"; + statenames[ROOT_structure] = NULL; + statenames[AL_structure] = NULL; + statenames[IN_structure] = "structure"; + statenames[ROOT_list] = NULL; + statenames[AL_list] = NULL; + statenames[IN_list] = "list"; + statenames[ROOT_cell] = NULL; + statenames[AL_cell] = NULL; + statenames[IN_cell] = "cell"; +} +%} + +%% + + /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ + SET(PROLOG); FleXML_init(); + + /* COMMENTS and PIs: handled uniformly for efficiency. */ + +<ROOT_octave,AL_octave,S_octave,E_octave,ROOT_scalar,AL_scalar,IN_scalar,ROOT_complex,AL_complex,S_complex,S_complex_1,E_complex,ROOT_string,AL_string,IN_string,ROOT_array,AL_array,S_array,S_array_1,S_array_2,S_array_3,E_array,ROOT_matrix,AL_matrix,S_matrix,S_matrix_1,S_matrix_2,E_matrix,ROOT_structure,AL_structure,IN_structure,ROOT_list,AL_list,IN_list,ROOT_cell,AL_cell,IN_cell,PROLOG,DOCTYPE,EPILOG>{ + "<!--" ENTER(INCOMMENT); + "<?" ENTER(INPI); +} +<INCOMMENT>{ + "-->" LEAVE; + "--" | + . | + \n SKIP; + <<EOF>> FAIL("EOF in comment."); +} +<INPI>{ + "?>" LEAVE; + . | + \n SKIP; + <<EOF>> FAIL("EOF in PI (processing instruction)."); +} + + /* SPACES: skipped uniformly */ + +<ROOT_octave,AL_octave,S_octave,E_octave,ROOT_scalar,AL_scalar,ROOT_complex,AL_complex,S_complex,S_complex_1,E_complex,ROOT_string,AL_string,ROOT_array,AL_array,S_array,S_array_1,S_array_2,S_array_3,E_array,ROOT_matrix,AL_matrix,S_matrix,S_matrix_1,S_matrix_2,E_matrix,ROOT_structure,AL_structure,ROOT_list,AL_list,ROOT_cell,AL_cell,PROLOG,DOCTYPE,EPILOG>{S} SKIP; + + /* PROLOG: determine root element and process it. */ + +<PROLOG>{ + "<?xml"({S}version{Eq}(\'{VersionNum}\'|\"{VersionNum}\"))?"?>" SET(DOCTYPE); + "<?xml"[^>]*">" FAIL("Bad declaration %s.",yytext); +} + +<PROLOG,DOCTYPE>{ + "<!DOCTYPE"{S}"scalar"{S}SYSTEM{S}("'octave.dtd'"|"\"octave.dtd\""){s}">" SET(ROOT_scalar); + "<!DOCTYPE"{S}"octave"{S}SYSTEM{S}("'octave.dtd'"|"\"octave.dtd\""){s}">" SET(ROOT_octave); + "<!DOCTYPE"{S}"complex"{S}SYSTEM{S}("'octave.dtd'"|"\"octave.dtd\""){s}">" SET(ROOT_complex); + "<!DOCTYPE"{S}"string"{S}SYSTEM{S}("'octave.dtd'"|"\"octave.dtd\""){s}">" SET(ROOT_string); + "<!DOCTYPE"{S}"matrix"{S}SYSTEM{S}("'octave.dtd'"|"\"octave.dtd\""){s}">" SET(ROOT_matrix); + "<!DOCTYPE"{S}"array"{S}SYSTEM{S}("'octave.dtd'"|"\"octave.dtd\""){s}">" SET(ROOT_array); + "<!DOCTYPE"{S}"structure"{S}SYSTEM{S}("'octave.dtd'"|"\"octave.dtd\""){s}">" SET(ROOT_structure); + "<!DOCTYPE"{S}"cell"{S}SYSTEM{S}("'octave.dtd'"|"\"octave.dtd\""){s}">" SET(ROOT_cell); + "<!DOCTYPE"{S}"list"{S}SYSTEM{S}("'octave.dtd'"|"\"octave.dtd\""){s}">" SET(ROOT_list); + "<!"[^>-][^>]*">" FAIL("Bad declaration %s.",yytext); + . FAIL("Unexpected character `%c' in prolog.", yytext[0]); + <<EOF>> FAIL("EOF in prolog."); +} + + /* RULES DERIVED FROM DTD. */ + +<ROOT_octave,IN_list,IN_structure,IN_cell>"<octave"{s} { + ENTER(AL_octave); + } + +<AL_octave>{ + ">" { + LEAVE; STag_octave(); pcdata = NULL; ENTER(S_octave); + } + "/>" FAIL("`octave' element cannot be empty."); + . FAIL("Unexpected character `%c' in attribute list of octave element.", yytext[0]); + {Name} FAIL("Bad attribute `%s' in `octave' element start tag.",yytext); + <<EOF>> FAIL("EOF in attribute list of `octave' element."); +} + +<E_octave>{ + "</octave"{s}">" { + LEAVE; + ETag_octave(); + switch (YY_START) { + case ROOT_octave: SET(EPILOG); break; + } + } + "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</octave>' expected.",yytext); + . FAIL("Unexpected character `%c': `</octave>' expected.",yytext[0]); + <<EOF>> FAIL("Premature EOF: `</octave>' expected."); +} + + /* value (undefined | true | false | inf | neginf | na | nan) "undefined" + * name CDATA #IMPLIED> */ + +<ROOT_scalar,IN_list,S_matrix_2,IN_cell,S_octave,S_complex,S_matrix_1,S_complex_1,S_matrix,IN_structure>"<scalar"{s} { + A_scalar_value = A_scalar_value_undefined; + A_scalar_name = NULL; + ENTER(AL_scalar); + } + +<AL_scalar>{ + "value"{Eq}"'undefined'" | + "value"{Eq}"\"undefined\"" A_scalar_value = A_scalar_value_undefined; + "value"{Eq}"'true'" | + "value"{Eq}"\"true\"" A_scalar_value = A_scalar_value_true; + "value"{Eq}"'false'" | + "value"{Eq}"\"false\"" A_scalar_value = A_scalar_value_false; + "value"{Eq}"'inf'" | + "value"{Eq}"\"inf\"" A_scalar_value = A_scalar_value_inf; + "value"{Eq}"'neginf'" | + "value"{Eq}"\"neginf\"" A_scalar_value = A_scalar_value_neginf; + "value"{Eq}"'na'" | + "value"{Eq}"\"na\"" A_scalar_value = A_scalar_value_na; + "value"{Eq}"'nan'" | + "value"{Eq}"\"nan\"" A_scalar_value = A_scalar_value_nan; + + "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_scalar_name); + "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_scalar_name); + + ">" { + LEAVE; STag_scalar(); pcdata = BUFFERSET(pcdata); ENTER(IN_scalar); + } + "/>" { + LEAVE; STag_scalar(); pcdata = ""; ETag_scalar(); + switch (YY_START) { + case S_complex_1: SET(E_complex); break; + case S_octave: SET(E_octave); break; + case S_complex: SET(S_complex_1); break; + case S_matrix_1: case S_matrix: case S_matrix_2: SET(S_matrix_2); break; + case ROOT_scalar: SET(EPILOG); break; + } + } + . FAIL("Unexpected character `%c' in attribute list of scalar element.", yytext[0]); + {Name} FAIL("Bad attribute `%s' in `scalar' element start tag.",yytext); + <<EOF>> FAIL("EOF in attribute list of `scalar' element."); +} + +<IN_scalar>{ + "</scalar"{s}">" { + LEAVE; + BUFFERDONE; + ETag_scalar(); + switch (YY_START) { + case S_complex_1: SET(E_complex); break; + case S_octave: SET(E_octave); break; + case S_complex: SET(S_complex_1); break; + case S_matrix_1: case S_matrix: case S_matrix_2: SET(S_matrix_2); break; + case ROOT_scalar: SET(EPILOG); break; + } + } + "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</scalar>' expected.",yytext); + <<EOF>> FAIL("Premature EOF: `</scalar>' expected."); +} + +<ROOT_complex,IN_list,S_matrix_2,IN_cell,S_octave,S_matrix_1,S_matrix,IN_structure>"<complex"{s} { + A_complex_name = NULL; + ENTER(AL_complex); + } + +<AL_complex>{ + "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_complex_name); + "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_complex_name); + + ">" { + LEAVE; STag_complex(); pcdata = NULL; ENTER(S_complex); + } + "/>" FAIL("`complex' element cannot be empty."); + . FAIL("Unexpected character `%c' in attribute list of complex element.", yytext[0]); + {Name} FAIL("Bad attribute `%s' in `complex' element start tag.",yytext); + <<EOF>> FAIL("EOF in attribute list of `complex' element."); +} + +<E_complex>{ + "</complex"{s}">" { + LEAVE; + ETag_complex(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case S_matrix_1: case S_matrix: case S_matrix_2: SET(S_matrix_2); break; + case ROOT_complex: SET(EPILOG); break; + } + } + "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</complex>' expected.",yytext); + . FAIL("Unexpected character `%c': `</complex>' expected.",yytext[0]); + <<EOF>> FAIL("Premature EOF: `</complex>' expected."); +} + + /* length CDATA #REQUIRED + * name CDATA #IMPLIED> */ + +<ROOT_string,S_array,IN_list,S_array_1,IN_cell,S_octave,S_array_2,S_array_3,IN_structure>"<string"{s} { + A_string_length = NULL; + A_string_name = NULL; + ENTER(AL_string); + } + +<AL_string>{ + "length"{Eq}\' ENTER(VALUE1); BUFFERSET(A_string_length); + "length"{Eq}\" ENTER(VALUE2); BUFFERSET(A_string_length); + + "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_string_name); + "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_string_name); + + ">" { + if (!A_string_length) FAIL("Required attribute `length' not set for `string' element."); + LEAVE; STag_string(); pcdata = BUFFERSET(pcdata); ENTER(IN_string); + } + "/>" { + if (!A_string_length) FAIL("Required attribute `length' not set for `string' element."); + LEAVE; STag_string(); pcdata = ""; ETag_string(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case S_array_2: case S_array_3: case S_array_1: SET(S_array_3); break; + case ROOT_string: SET(EPILOG); break; + case S_array: SET(S_array_1); break; + } + } + . FAIL("Unexpected character `%c' in attribute list of string element.", yytext[0]); + {Name} FAIL("Bad attribute `%s' in `string' element start tag.",yytext); + <<EOF>> FAIL("EOF in attribute list of `string' element."); +} + +<IN_string>{ + "</string"{s}">" { + LEAVE; + BUFFERDONE; + ETag_string(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case S_array_2: case S_array_3: case S_array_1: SET(S_array_3); break; + case ROOT_string: SET(EPILOG); break; + case S_array: SET(S_array_1); break; + } + } + "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</string>' expected.",yytext); + <<EOF>> FAIL("Premature EOF: `</string>' expected."); +} + + /* rows CDATA #REQUIRED + * name CDATA #IMPLIED> */ + +<ROOT_array,IN_list,IN_cell,S_octave,IN_structure>"<array"{s} { + A_array_rows = NULL; + A_array_name = NULL; + ENTER(AL_array); + } + +<AL_array>{ + "rows"{Eq}\' ENTER(VALUE1); BUFFERSET(A_array_rows); + "rows"{Eq}\" ENTER(VALUE2); BUFFERSET(A_array_rows); + + "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_array_name); + "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_array_name); + + ">" { + if (!A_array_rows) FAIL("Required attribute `rows' not set for `array' element."); + LEAVE; STag_array(); pcdata = NULL; ENTER(S_array); + } + "/>" FAIL("`array' element cannot be empty."); + . FAIL("Unexpected character `%c' in attribute list of array element.", yytext[0]); + {Name} FAIL("Bad attribute `%s' in `array' element start tag.",yytext); + <<EOF>> FAIL("EOF in attribute list of `array' element."); +} + +<S_array_3,E_array>{ + "</array"{s}">" { + LEAVE; + ETag_array(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case ROOT_array: SET(EPILOG); break; + } + } + "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</array>' expected.",yytext); + . FAIL("Unexpected character `%c': `</array>' expected.",yytext[0]); + <<EOF>> FAIL("Premature EOF: `</array>' expected."); +} + + /* rows CDATA #REQUIRED + * columns CDATA #REQUIRED + * name CDATA #IMPLIED> */ + +<ROOT_matrix,IN_list,IN_cell,IN_structure>"<matrix"{s} { + A_matrix_rows = NULL; + A_matrix_columns = NULL; + A_matrix_name = NULL; + ENTER(AL_matrix); + } + +<AL_matrix>{ + "rows"{Eq}\' ENTER(VALUE1); BUFFERSET(A_matrix_rows); + "rows"{Eq}\" ENTER(VALUE2); BUFFERSET(A_matrix_rows); + + "columns"{Eq}\' ENTER(VALUE1); BUFFERSET(A_matrix_columns); + "columns"{Eq}\" ENTER(VALUE2); BUFFERSET(A_matrix_columns); + + "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_matrix_name); + "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_matrix_name); + + ">" { + if (!A_matrix_rows) FAIL("Required attribute `rows' not set for `matrix' element."); + if (!A_matrix_columns) FAIL("Required attribute `columns' not set for `matrix' element."); + LEAVE; STag_matrix(); pcdata = NULL; ENTER(S_matrix); + } + "/>" { + if (!A_matrix_rows) FAIL("Required attribute `rows' not set for `matrix' element."); + if (!A_matrix_columns) FAIL("Required attribute `columns' not set for `matrix' element."); + LEAVE; STag_matrix(); pcdata = NULL; ETag_matrix(); + switch (YY_START) { + case ROOT_matrix: SET(EPILOG); break; + } + } + . FAIL("Unexpected character `%c' in attribute list of matrix element.", yytext[0]); + {Name} FAIL("Bad attribute `%s' in `matrix' element start tag.",yytext); + <<EOF>> FAIL("EOF in attribute list of `matrix' element."); +} + +<S_matrix,S_matrix_2,E_matrix>{ + "</matrix"{s}">" { + LEAVE; + ETag_matrix(); + switch (YY_START) { + case ROOT_matrix: SET(EPILOG); break; + } + } + "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</matrix>' expected.",yytext); + . FAIL("Unexpected character `%c': `</matrix>' expected.",yytext[0]); + <<EOF>> FAIL("Premature EOF: `</matrix>' expected."); +} + +<ROOT_structure,IN_list,IN_cell,S_octave,IN_structure>"<structure"{s} { + A_structure_name = NULL; + ENTER(AL_structure); + } + +<AL_structure>{ + "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_structure_name); + "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_structure_name); + + ">" { + LEAVE; STag_structure(); pcdata = BUFFERSET(pcdata); ENTER(IN_structure); + } + "/>" { + LEAVE; STag_structure(); pcdata = ""; ETag_structure(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case ROOT_structure: SET(EPILOG); break; + } + } + . FAIL("Unexpected character `%c' in attribute list of structure element.", yytext[0]); + {Name} FAIL("Bad attribute `%s' in `structure' element start tag.",yytext); + <<EOF>> FAIL("EOF in attribute list of `structure' element."); +} + +<IN_structure>{ + "</structure"{s}">" { + LEAVE; + BUFFERDONE; + ETag_structure(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case ROOT_structure: SET(EPILOG); break; + } + } + "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</structure>' expected.",yytext); + <<EOF>> FAIL("Premature EOF: `</structure>' expected."); +} + + /* length CDATA #REQUIRED + * name CDATA #IMPLIED> */ + +<ROOT_list,IN_list,IN_cell,S_octave,IN_structure>"<list"{s} { + A_list_length = NULL; + A_list_name = NULL; + ENTER(AL_list); + } + +<AL_list>{ + "length"{Eq}\' ENTER(VALUE1); BUFFERSET(A_list_length); + "length"{Eq}\" ENTER(VALUE2); BUFFERSET(A_list_length); + + "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_list_name); + "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_list_name); + + ">" { + if (!A_list_length) FAIL("Required attribute `length' not set for `list' element."); + LEAVE; STag_list(); pcdata = BUFFERSET(pcdata); ENTER(IN_list); + } + "/>" { + if (!A_list_length) FAIL("Required attribute `length' not set for `list' element."); + LEAVE; STag_list(); pcdata = ""; ETag_list(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case ROOT_list: SET(EPILOG); break; + } + } + . FAIL("Unexpected character `%c' in attribute list of list element.", yytext[0]); + {Name} FAIL("Bad attribute `%s' in `list' element start tag.",yytext); + <<EOF>> FAIL("EOF in attribute list of `list' element."); +} + +<IN_list>{ + "</list"{s}">" { + LEAVE; + BUFFERDONE; + ETag_list(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case ROOT_list: SET(EPILOG); break; + } + } + "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</list>' expected.",yytext); + <<EOF>> FAIL("Premature EOF: `</list>' expected."); +} + + /* rows CDATA #REQUIRED + * columns CDATA #REQUIRED + * name CDATA #IMPLIED> */ + +<ROOT_cell,IN_list,IN_cell,S_octave,IN_structure>"<cell"{s} { + A_cell_rows = NULL; + A_cell_columns = NULL; + A_cell_name = NULL; + ENTER(AL_cell); + } + +<AL_cell>{ + "rows"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cell_rows); + "rows"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cell_rows); + + "columns"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cell_columns); + "columns"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cell_columns); + + "name"{Eq}\' ENTER(VALUE1); BUFFERSET(A_cell_name); + "name"{Eq}\" ENTER(VALUE2); BUFFERSET(A_cell_name); + + ">" { + if (!A_cell_rows) FAIL("Required attribute `rows' not set for `cell' element."); + if (!A_cell_columns) FAIL("Required attribute `columns' not set for `cell' element."); + LEAVE; STag_cell(); pcdata = BUFFERSET(pcdata); ENTER(IN_cell); + } + "/>" { + if (!A_cell_rows) FAIL("Required attribute `rows' not set for `cell' element."); + if (!A_cell_columns) FAIL("Required attribute `columns' not set for `cell' element."); + LEAVE; STag_cell(); pcdata = ""; ETag_cell(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case ROOT_cell: SET(EPILOG); break; + } + } + . FAIL("Unexpected character `%c' in attribute list of cell element.", yytext[0]); + {Name} FAIL("Bad attribute `%s' in `cell' element start tag.",yytext); + <<EOF>> FAIL("EOF in attribute list of `cell' element."); +} + +<IN_cell>{ + "</cell"{s}">" { + LEAVE; + BUFFERDONE; + ETag_cell(); + switch (YY_START) { + case S_octave: SET(E_octave); break; + case ROOT_cell: SET(EPILOG); break; + } + } + "</"{Name}{s}">" FAIL("Unexpected end-tag `%s': `</cell>' expected.",yytext); + <<EOF>> FAIL("Premature EOF: `</cell>' expected."); +} + + /* EPILOG: after the root element. */ + +<EPILOG>{ + . FAIL("Unexpected character `%c' after document.", yytext[0]); + <<EOF>> SUCCEED; +} + + /* CHARACTER DATA. */ + +<IN_scalar,IN_structure,IN_string,IN_cell,IN_list,VALUE1,VALUE2>{ + /* 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)); +} + +<IN_scalar,IN_structure,IN_string,IN_cell,IN_list,VALUE1,VALUE2,CDATA>{ + "\n" | + "\r" | + "\r\n" | + "\n\r" BUFFERPUTC('\n'); +} + +<IN_scalar,IN_structure,IN_string,IN_cell,IN_list>{ + "<![CDATA[" ENTER(CDATA); + "]]>" FAIL("Unexpected `]]>' in character data."); +} + +<VALUE1>{ + \' BUFFERDONE; LEAVE; + <<EOF>> FAIL("EOF in literal (\"'\" expected)."); +} + +<VALUE2>{ + \" BUFFERDONE; LEAVE; + <<EOF>> FAIL("EOF in literal (`\"' expected)."); +} + +<IN_scalar,IN_structure,IN_string,IN_cell,IN_list,VALUE1,VALUE2>{ + [^<&] BUFFERPUTC(yytext[0]); + [<&] FAIL("Spurious `%c' in character data.",yytext[0]); +} + +<CDATA>{ + "]]>" LEAVE; + "]]" BUFFERPUTC(yytext[0]); BUFFERPUTC(yytext[1]); + . BUFFERPUTC(yytext[0]); + <<EOF>> FAIL("EOF in CDATA section."); +} + + /* Impossible rules to avoid warnings from flex(1). */ + +<INITIAL,IMPOSSIBLE>{ + .|[\n] FAIL("The Impossible Happened: INITIAL or IMPOSSIBLE state entered?"); +} + +%% + +/* Element context stack lookup. */ +int element_context(int i) +{ + return (0<i && i<yy_start_stack_depth + ? yy_start_stack[yy_start_stack_ptr - i] + : 0); +} + +#ifdef FLEX_DEBUG +void print_yy_stack(char* fmt, ...) +{ + int i = 0; va_list ap; va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + for (i=1; i<yy_start_stack_ptr; i++) + fprintf(stderr, "%s/", statenames[yy_start_stack[i]]); + fprintf(stderr,"%s\n", statenames[YY_START]); + va_end(ap); +} + +static void debug_enter(int state, char* statename) { + yy_push_state(state); + if (yy_flex_debug) print_yy_stack("--ENTER(%s) : ",statename); +} + +static void debug_leave(void) { + if (yy_flex_debug) print_yy_stack("--LEAVE : "); + yy_pop_state(); +} + +static void debug_set(int state, char* statename) { + BEGIN(state); + if (yy_flex_debug) print_yy_stack("--SET(%s) : ",statename); +} +#endif + + +static int fail(const char* fmt, ...) +{ + va_list ap; va_start(ap, fmt); +#ifdef FLEXML_yylineno + fprintf(stderr, "Invalid XML (XML input line %d, state %d): ", yylineno, YY_START); +#else + fprintf(stderr, "Invalid XML (state %d): ",YY_START); +#endif + vfprintf(stderr, fmt, ap); + fprintf(stderr, "\n"); + va_end(ap); + return 1; +} + +#line 30 "xmltree_read.act" + +#include <stdlib.h> +#include "xmltree.h" + +#define warning perror + +element **current; +element *root; +list *lastlist; + +void STag_octave(void) +{ +#line 43 "xmltree_read.act" + +root = new_element(); +root->def_value = value_data; +current = &(root->child); + +lastlist = new_list(lastlist); +lastlist->root = current; + +} /* STag_octave */ + +void ETag_octave(void) +{ +#line 52 "xmltree_read.act" + +current = lastlist->root; +lastlist = pop_list(lastlist); +current = &((*current)->next); + +} /* ETag_octave */ + +void STag_scalar(void) +{ +#line 60 "xmltree_read.act" + +*current = new_element(); + +if (A_scalar_name) { + (*current)->name = (char *) malloc(strlen(A_scalar_name)+1); + strcpy ((*current)->name, A_scalar_name); +} + +(*current)->def_value = value_scalar; +switch (A_scalar_value) { + case A_scalar_value_true: (*current)->const_value = const_true; break; + case A_scalar_value_false: (*current)->const_value = const_false; break; + case A_scalar_value_inf: (*current)->const_value = const_inf; break; + case A_scalar_value_neginf: (*current)->const_value = const_neginf; break; + case A_scalar_value_nan: (*current)->const_value = const_nan; break; + case A_scalar_value_na: (*current)->const_value = const_na; break; + default: (*current)->const_value = const_undef; +} + +} /* STag_scalar */ + +void ETag_scalar(void) +{ +#line 80 "xmltree_read.act" + +if (((*current)->const_value == const_undef) && (pcdata)) + (*current)->scalar_value = strtod (pcdata, NULL); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); + +} /* ETag_scalar */ + +void STag_string(void) +{ +#line 91 "xmltree_read.act" + +*current = new_element(); + +if (A_string_name) { + (*current)->name = (char *) malloc(strlen(A_string_name)+1); + strcpy ((*current)->name, A_string_name); +} + +if (A_string_length) + (*current)->length = strtol (A_string_length, NULL, 10); + +(*current)->def_value = value_string; + +} /* STag_string */ + +void ETag_string(void) +{ +#line 105 "xmltree_read.act" + +if (pcdata) { + + int len = strlen(pcdata); + /* check length parameter */ + if ((*current)->length != len) { + warning("incorrect length parameter for string\n"); + (*current)->length = len; + } + + (*current)->string_value = (char *) malloc ((len+1) * sizeof(char)); + strcpy((*current)->string_value, pcdata); +} + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); + +} /* ETag_string */ + +void STag_complex(void) +{ +#line 126 "xmltree_read.act" + +*current = new_element(); + +if (A_complex_name) { + (*current)->name = (char *) malloc(strlen(A_complex_name)+1); + strcpy ((*current)->name, A_complex_name); +} + +(*current)->def_value = value_complex; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); + +} /* STag_complex */ + +void ETag_complex(void) +{ +#line 141 "xmltree_read.act" + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); + +} /* ETag_complex */ + +void STag_array(void) +{ +#line 152 "xmltree_read.act" + +*current = new_element(); + +if (A_array_name) { + (*current)->name = (char *) malloc(strlen(A_array_name)+1); + strcpy ((*current)->name, A_array_name); +} + +if (A_array_rows) + (*current)->rows = strtol (A_array_rows, NULL, 10); + +(*current)->def_value = value_array; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); + +} /* STag_array */ + +void ETag_array(void) +{ +#line 170 "xmltree_read.act" + +/* check rows parameter */ +if ((*(lastlist->root))->rows != (*(lastlist->root))->nb_elements) { + warning("incorrect length parameter for array\n"); + (*(lastlist->root))->rows = (*(lastlist->root))->nb_elements; +} + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); + +} /* ETag_array */ + +void STag_matrix(void) +{ +#line 187 "xmltree_read.act" + +*current = new_element(); + +if (A_matrix_name) { + (*current)->name = (char *) malloc(strlen(A_matrix_name)+1); + strcpy ((*current)->name, A_matrix_name); +} + +if (A_matrix_rows) + (*current)->rows = strtol (A_matrix_rows, NULL, 10); + +if (A_matrix_columns) + (*current)->columns = strtol (A_matrix_columns, NULL, 10); + +(*current)->def_value = value_matrix; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); + +} /* STag_matrix */ + +void ETag_matrix(void) +{ +#line 208 "xmltree_read.act" + +/* check (rows, columns) parameters */ +if ((*(lastlist->root))->rows * (*(lastlist->root))->columns != + (*(lastlist->root))->nb_elements) { + warning("incorrect (rows, columns) parameters for matrix: reshaping matrix into vector\n"); + (*(lastlist->root))->rows = 1; + (*(lastlist->root))->columns = (*(lastlist->root))->nb_elements; +} + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); + +} /* ETag_matrix */ + +void STag_structure(void) +{ +#line 227 "xmltree_read.act" + +*current = new_element(); + +if (A_structure_name) { + (*current)->name = (char *) malloc(strlen(A_structure_name)+1); + strcpy ((*current)->name, A_structure_name); +} + +(*current)->def_value = value_structure; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); + +} /* STag_structure */ + +void ETag_structure(void) +{ +#line 242 "xmltree_read.act" + +/* no check possible (sic) */ + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); + +} /* ETag_structure */ + +void STag_list(void) +{ +#line 255 "xmltree_read.act" + +*current = new_element(); + +if (A_list_name) { + (*current)->name = (char *) malloc(strlen(A_list_name)+1); + strcpy ((*current)->name, A_list_name); +} + +if (A_list_length) + (*current)->length = strtol (A_list_length, NULL, 10); + +(*current)->def_value = value_list; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); + +} /* STag_list */ + +void ETag_list(void) +{ +#line 273 "xmltree_read.act" + +/* check length parameter */ +if ((*(lastlist->root))->length != (*(lastlist->root))->nb_elements) { + warning("incorrect length parameter for list\n"); + (*(lastlist->root))->length = (*(lastlist->root))->nb_elements; +} + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); + +} /* ETag_list */ + +void STag_cell(void) +{ +#line 290 "xmltree_read.act" + +*current = new_element(); + +if (A_cell_name) { + (*current)->name = (char *) malloc(strlen(A_cell_name)+1); + strcpy ((*current)->name, A_cell_name); +} + +if (A_cell_rows) + (*current)->rows = strtol (A_cell_rows, NULL, 10); + +if (A_cell_columns) + (*current)->columns = strtol (A_cell_columns, NULL, 10); + +(*current)->def_value = value_cell; + +lastlist = new_list(lastlist); +lastlist->root = current; +current = &((*current)->child); + +} /* STag_cell */ + +void ETag_cell(void) +{ +#line 311 "xmltree_read.act" + +/* check (rows, columns) parameters */ +if ((*(lastlist->root))->rows * (*(lastlist->root))->columns != + (*(lastlist->root))->nb_elements) { + warning("incorrect (rows, columns) parameters for cell: reshaping cell into list\n"); + (*(lastlist->root))->def_value = value_list; + (*(lastlist->root))->length = (*(lastlist->root))->nb_elements; +} + +current = lastlist->root; +lastlist = pop_list(lastlist); + +(*(lastlist->root))->nb_elements++; + +current = &((*current)->next); + +} /* ETag_cell */ + + +#line 346 "xmltree_read.act" + +element *read_xmltree (const char *file) { + + current = NULL; + root = NULL; + lastlist = NULL; + + yyin = fopen(file, "r"); + if (!yyin) + perror("can't open file\n"); + + yylex(); + fclose(yyin); + + return root; +} + + +/* XML application entry points. */