Re: [OctDev] Re: Three build failures on alpha,hppa,ia64 (Re: octave-forge 2004-02-12 release)

Laurent Mazet <[email protected]> Fri, 13 Feb 2004 16:30:30 +0100
Newsgroups gmane.comp.gnu.octave.sources
Organization Motorola
Message-ID <[email protected]>
On Fri, 13 Feb 2004 08:03:25 -0500
Paul Kienzle <[email protected]> wrote:

> Replacing the $(CC) with $(MKOCTFILE) in
> main/miscellaneous/Makefile should work.

Ok, I committed  your patch.

>  We have another
> problem, though, in that the yyin symbol from xmltree_read
> conflicts with the yyin/yyout symbols from octave's lexer, giving the
> following error on OS X:
>...

I modified the flex command to change all yy* into xml_*

I also change the buffer size of the parser to enable the parsing of large file
(~2MB). I will make a better fix asap.

     Laurent
-- 
Dr. Laurent Mazet: Research Engineer /V\ Centre de Recherche de MOTOROLA
Tel: +33 (0)1 69 35 48 30 =-=-=-=-=-=-=-=-=-=-= Email: [email protected]
xml-octave-forge.diff (application/octet-stream, 8.9 KB)
? test.xml
? xml-octave-forge.diff
Index: Makefile
===================================================================
RCS file: /cvsroot/octave/octave-forge/main/miscellaneous/Makefile,v
retrieving revision 1.9
diff -c -r1.9 Makefile
*** Makefile	31 Jan 2004 21:45:28 -0000	1.9
--- Makefile	13 Feb 2004 14:03:13 -0000
***************
*** 23,29 ****
  	$(MKOCTFILE) -c listencanfork.c
  
  xmltree.o: xmltree.c xmltree.h
! 	$(CC) -c $< -o $@
  
  ifdef FLEXML
  xmltree_read.l: xmltree_read.act octave.dtd
--- 23,29 ----
  	$(MKOCTFILE) -c listencanfork.c
  
  xmltree.o: xmltree.c xmltree.h
! 	$(MKOCTFILE) $(MISCDEFS) -c $<
  
  ifdef FLEXML
  xmltree_read.l: xmltree_read.act octave.dtd
***************
*** 32,47 ****
  
  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 *~
--- 32,47 ----
  
  ifdef FLEX
  xmltree_read.c: xmltree_read.l
! 	$(FLEX) -B -Pxml_ -o$@ $<
  endif
  
  xmltree_read.o: xmltree_read.c xmltree_read.h
! 	$(MKOCTFILE) $(MISCDEFS) -c $<
  
  xmlread.o: xmlread.cc xmltree_read.h xmltree.h
! 	$(MKOCTFILE) $(MISCDEFS) -c $<
  
  xmlread.oct: xmlread.o xmltree_read.o xmltree.o
! 	$(MKOCTFILE) $^
  
  clean: ; -$(RM) *.o octave-core core *.oct *~
Index: xmlread.cc
===================================================================
RCS file: /cvsroot/octave/octave-forge/main/miscellaneous/xmlread.cc,v
retrieving revision 1.1
diff -c -r1.1 xmlread.cc
*** xmlread.cc	31 Jan 2004 21:45:28 -0000	1.1
--- xmlread.cc	13 Feb 2004 14:03:13 -0000
***************
*** 134,140 ****
  
  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") {
--- 134,140 ----
  
  DEFUN_DLD (xmlread, args, nargout,
  	   "-*- texinfo -*-\n"
!            "@deftypefn {Function File} {@var{value}} xmlread(@var{filename})\n"
  	   "\n"
  	   "Read a @var{value} from @var{filename} as an XML file\n"
  	   "@end deftypefn") {
Index: xmltree_read.act
===================================================================
RCS file: /cvsroot/octave/octave-forge/main/miscellaneous/xmltree_read.act,v
retrieving revision 1.1
diff -c -r1.1 xmltree_read.act
*** xmltree_read.act	31 Jan 2004 21:45:28 -0000	1.1
--- xmltree_read.act	13 Feb 2004 14:03:13 -0000
***************
*** 334,345 ****
    root = NULL;
    lastlist = NULL;
  
!   yyin = fopen(file, "r");
!   if (!yyin)
      perror("can't open file\n");
  
!   yylex();
!   fclose(yyin);
    
    return root;
  }
--- 334,345 ----
    root = NULL;
    lastlist = NULL;
  
!   xml_in = fopen(file, "r");
!   if (!xml_in)
      perror("can't open file\n");
  
!   xml_lex();
!   fclose(xml_in);
    
    return root;
  }
Index: xmltree_read.c
===================================================================
RCS file: /cvsroot/octave/octave-forge/main/miscellaneous/xmltree_read.c,v
retrieving revision 1.1
diff -c -r1.1 xmltree_read.c
*** xmltree_read.c	31 Jan 2004 21:45:28 -0000	1.1
--- xmltree_read.c	13 Feb 2004 14:03:20 -0000
***************
*** 1,8 ****
! #line 2 "xmltree_read.c"
  /* A lexical scanner generated by flex */
  
  /* Scanner skeleton version:
!  * $Header: /cvsroot/octave/octave-forge/main/miscellaneous/xmltree_read.c,v 1.1 2004/01/31 21:45:28 mazet Exp $
   */
  
  #define FLEX_SCANNER
--- 1,25 ----
! #define yy_create_buffer xml__create_buffer
! #define yy_delete_buffer xml__delete_buffer
! #define yy_scan_buffer xml__scan_buffer
! #define yy_scan_string xml__scan_string
! #define yy_scan_bytes xml__scan_bytes
! #define yy_flex_debug xml__flex_debug
! #define yy_init_buffer xml__init_buffer
! #define yy_flush_buffer xml__flush_buffer
! #define yy_load_buffer_state xml__load_buffer_state
! #define yy_switch_to_buffer xml__switch_to_buffer
! #define yyin xml_in
! #define yyleng xml_leng
! #define yylex xml_lex
! #define yyout xml_out
! #define yyrestart xml_restart
! #define yytext xml_text
! 
! #line 19 "xmltree_read.c"
  /* A lexical scanner generated by flex */
  
  /* Scanner skeleton version:
!  * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
   */
  
  #define FLEX_SCANNER
***************
*** 103,109 ****
  #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;
  
--- 120,126 ----
  #define YY_END_OF_BUFFER_CHAR 0
  
  /* Size of default input buffer. */
! #define YY_BUF_SIZE 1638400
  
  typedef struct yy_buffer_state *YY_BUFFER_STATE;
  
***************
*** 1427,1433 ****
  #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).
--- 1444,1450 ----
  #line 1 "xmltree_read.l"
  #define INITIAL 0
  /* Validating XML processor for octave.dtd.
!  * Generated 2004/02/13 14:47:24.
   *
   * This program was generated with the FleXML XML processor generator,
   * (Id: flexml.pl,v 1.28 2003/02/12 02:55:41 krisrose Exp).
***************
*** 1465,1471 ****
  #include <ctype.h>
  
  /* Generated definitions. */
! #define FLEXML_BUFFERSTACKSIZE 100000
  
  /* XML application entry points. */
  static void STag_octave(void);
--- 1482,1488 ----
  #include <ctype.h>
  
  /* Generated definitions. */
! #define FLEXML_BUFFERSTACKSIZE 10000000
  
  /* XML application entry points. */
  static void STag_octave(void);
***************
*** 1744,1750 ****
    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.
--- 1761,1767 ----
    statenames[AL_cell] = NULL;
    statenames[IN_cell] = "cell";
  }
! #line 1765 "xmltree_read.c"
  
  /* Macros after this point can all be overridden by user definitions in
   * section 1.
***************
*** 1815,1821 ****
  
  /* 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. */
--- 1832,1838 ----
  
  /* Amount of stuff to slurp up with each read. */
  #ifndef YY_READ_BUF_SIZE
! #define YY_READ_BUF_SIZE 819200
  #endif
  
  /* Copy whatever the last rule matched to the standard output. */
***************
*** 1914,1920 ****
  
   /* COMMENTS and PIs: handled uniformly for efficiency. */
  
! #line 1918 "xmltree_read.c"
  
  	if ( yy_init )
  		{
--- 1931,1937 ----
  
   /* COMMENTS and PIs: handled uniformly for efficiency. */
  
! #line 1935 "xmltree_read.c"
  
  	if ( yy_init )
  		{
***************
*** 3106,3112 ****
  #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):
--- 3123,3129 ----
  #line 818 "xmltree_read.l"
  ECHO;
  	YY_BREAK
! #line 3127 "xmltree_read.c"
  case YY_STATE_EOF(INITIAL):
  case YY_STATE_EOF(ROOT_octave):
  case YY_STATE_EOF(S_octave):
***************
*** 4428,4439 ****
    root = NULL;
    lastlist = NULL;
  
!   yyin = fopen(file, "r");
!   if (!yyin)
      perror("can't open file\n");
  
!   yylex();
!   fclose(yyin);
    
    return root;
  }
--- 4445,4456 ----
    root = NULL;
    lastlist = NULL;
  
!   xml_in = fopen(file, "r");
!   if (!xml_in)
      perror("can't open file\n");
  
!   xml_lex();
!   fclose(xml_in);
    
    return root;
  }
Index: xmltree_read.l
===================================================================
RCS file: /cvsroot/octave/octave-forge/main/miscellaneous/xmltree_read.l,v
retrieving revision 1.1
diff -c -r1.1 xmltree_read.l
*** xmltree_read.l	31 Jan 2004 21:45:28 -0000	1.1
--- xmltree_read.l	13 Feb 2004 14:03:20 -0000
***************
*** 1,5 ****
  /* 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).
--- 1,5 ----
  /* Validating XML processor for octave.dtd.
!  * Generated 2004/02/13 14:47:24.
   *
   * This program was generated with the FleXML XML processor generator,
   * (Id: flexml.pl,v 1.28 2003/02/12 02:55:41 krisrose Exp).
***************
*** 1228,1239 ****
    root = NULL;
    lastlist = NULL;
  
!   yyin = fopen(file, "r");
!   if (!yyin)
      perror("can't open file\n");
  
!   yylex();
!   fclose(yyin);
    
    return root;
  }
--- 1228,1239 ----
    root = NULL;
    lastlist = NULL;
  
!   xml_in = fopen(file, "r");
!   if (!xml_in)
      perror("can't open file\n");
  
!   xml_lex();
!   fclose(xml_in);
    
    return root;
  }