You can subscribe to this list here.
2005 |
Jan
(4) |
Feb
(37) |
Mar
(7) |
Apr
(9) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
|
Mar
(12) |
Apr
(4) |
May
(1) |
Jun
(1) |
Jul
(18) |
Aug
(36) |
Sep
(15) |
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(7) |
Nov
(2) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(7) |
Nov
(3) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2013 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Martin Q. <mqu...@us...> - 2006-08-27 20:46:51
|
Update of /cvsroot/flexml/flexml In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv5268 Modified Files: skel Log Message: Circumvent constentness warnings in produced flexers (I use -Werror) Index: skel =================================================================== RCS file: /cvsroot/flexml/flexml/skel,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- skel 24 Aug 2006 20:39:39 -0000 1.35 +++ skel 27 Aug 2006 20:46:36 -0000 1.36 @@ -123,9 +123,9 @@ } #ifdef FLEXML_NEED_BUFFERLIT -static void bufferliteral(char c, int* pp, char* text) +static void bufferliteral(char c, int* pp, const char* text) { - char *s = (c ? strchr(text,c) : text-1), *e = strrchr(text,c); + char *s = (c ? strchr(text,c) : (char*)text-1), *e = strrchr(text,c); assert(s <= e); BUFFERSET(*pp); while (++s<e) { if (isspace(*s) && c) { BUFFERPUTC(' '); while (isspace(*s)) ++s; } |
From: Martin Q. <mqu...@us...> - 2006-08-27 19:25:44
|
Update of /cvsroot/flexml/flexml/debian In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv5122/debian Modified Files: changelog Log Message: Document William's changes (again ;) Index: changelog =================================================================== RCS file: /cvsroot/flexml/flexml/debian/changelog,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- changelog 22 Aug 2006 14:00:37 -0000 1.28 +++ changelog 27 Aug 2006 19:25:39 -0000 1.29 @@ -1,7 +1,11 @@ flexml (1.6-1) unstable; urgency=low [William Dowling] - * Fix bug 1538171: Only display the stacknames when they are defined (they + * Change the static buffstack into two dynamically allocated stacks. + This get rids of any stack size limitation; + This also solves #1529930 (parsing mixed content fails on sparc/solaris, + which were caused by misaligned pointers) + * Fix #1538171: Only display the stacknames when they are defined (they are not in the prolog) * Fix a bufferstack memleak. This fixes both leaks of attributes and leaks of pcdata. People using large XML files shouldn't have to use insane |
From: William D. <wdo...@us...> - 2006-08-24 20:39:42
|
Update of /cvsroot/flexml/flexml In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv29625 Modified Files: skel Log Message: Get rid of high-bit characters that had snuck in again. Index: skel =================================================================== RCS file: /cvsroot/flexml/flexml/skel,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- skel 24 Aug 2006 20:22:21 -0000 1.34 +++ skel 24 Aug 2006 20:39:39 -0000 1.35 @@ -1,8 +1,8 @@ /* Flex(1) XML processor skeleton scanner (in -*-C-*-). - * Copyright © 1999 Kristoffer Rose. All rights reserved. + * Copyright (C) 1999 Kristoffer Rose. All rights reserved. * * This file is part of the FleXML XML processor generator system. - * Copyright © 1999 Kristoffer Rose. All rights reserved. + * Copyright (C) 1999 Kristoffer Rose. All rights reserved. * * 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 |
From: William D. <wdo...@us...> - 2006-08-24 20:36:06
|
Update of /cvsroot/flexml/flexml/testbed In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv28111 Modified Files: Makefile Log Message: Pick up CC from ../Makefile.defs by default. Index: Makefile =================================================================== RCS file: /cvsroot/flexml/flexml/testbed/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile 24 Aug 2006 20:22:57 -0000 1.5 +++ Makefile 24 Aug 2006 20:36:03 -0000 1.6 @@ -26,8 +26,8 @@ # Compares test.out.std[out,err] with expected values COMPARE_OUT = $(MAKEUTILS_DIR)/CompareOut.pl -CC = /usr/bin/gcc-3.3 -Wall -CFLAGS = -O2 -g +#CC = /usr/bin/gcc-3.3 -Wall +#CFLAGS = -O2 -g #FLEXDEBUG = -d FLEXML = ../flexml -s ../skel -T../flexml-act |
From: William D. <wdo...@us...> - 2006-08-24 20:23:50
|
Update of /cvsroot/flexml/flexml/testbed In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv23016/testbed Modified Files: mixed-stratt.dtd Log Message: Add comment. Index: mixed-stratt.dtd =================================================================== RCS file: /cvsroot/flexml/flexml/testbed/mixed-stratt.dtd,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mixed-stratt.dtd 21 Aug 2006 18:24:23 -0000 1.1 +++ mixed-stratt.dtd 24 Aug 2006 20:23:47 -0000 1.2 @@ -1,4 +1,4 @@ - +<!-- test mixed content elements with string sttributes --> <!ELEMENT foo (#PCDATA|bar)*> <!ELEMENT bar (#PCDATA)> <!ATTLIST bar batt CDATA #REQUIRED> |
From: William D. <wdo...@us...> - 2006-08-24 20:23:27
|
Update of /cvsroot/flexml/flexml/testbed In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv22990/testbed Modified Files: mixed-enumatt.act mixed-stratt.act mixed1.act Log Message: #include <stdio.h> not "stdio.h". Index: mixed-enumatt.act =================================================================== RCS file: /cvsroot/flexml/flexml/testbed/mixed-enumatt.act,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mixed-enumatt.act 23 Aug 2006 16:18:43 -0000 1.1 +++ mixed-enumatt.act 24 Aug 2006 20:23:24 -0000 1.2 @@ -2,7 +2,7 @@ <actions> <top><![CDATA[ -#include "stdio.h" +#include <stdio.h> ]]></top> <start tag='reqatt'><![CDATA[ Index: mixed1.act =================================================================== RCS file: /cvsroot/flexml/flexml/testbed/mixed1.act,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mixed1.act 23 Aug 2006 16:17:50 -0000 1.2 +++ mixed1.act 24 Aug 2006 20:23:24 -0000 1.3 @@ -2,7 +2,7 @@ <actions> <top><![CDATA[ -#include "stdio.h" +#include <stdio.h> ]]></top> <end tag='bar'><![CDATA[ Index: mixed-stratt.act =================================================================== RCS file: /cvsroot/flexml/flexml/testbed/mixed-stratt.act,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mixed-stratt.act 23 Aug 2006 16:17:50 -0000 1.2 +++ mixed-stratt.act 24 Aug 2006 20:23:24 -0000 1.3 @@ -2,7 +2,7 @@ <actions> <top><![CDATA[ -#include "stdio.h" +#include <stdio.h> ]]></top> <start tag='bar'><![CDATA[ |
From: William D. <wdo...@us...> - 2006-08-24 20:23:00
|
Update of /cvsroot/flexml/flexml/testbed In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv22590/testbed Modified Files: Makefile Added Files: mixed-stratt-def.act mixed-stratt-def.dtd mixed-stratt-def.in mixed-stratt-def.stdout.expected Log Message: Add mixed-stratt-def test (mixed content; string-valued attributes with defaults); replace several repeated rules with a pattern rule. --- NEW FILE: mixed-stratt-def.dtd --- <!-- test mixed content elements with default string sttributes --> <!ELEMENT foo (#PCDATA|bar)*> <!ELEMENT bar (#PCDATA)> <!ATTLIST bar batt CDATA 'default value' batt2 CDATA 'second default value' batt3 CDATA 'third default value' > --- NEW FILE: mixed-stratt-def.act --- <!DOCTYPE actions SYSTEM "flexml-act.dtd"> <actions> <top><![CDATA[ #include <stdio.h> ]]></top> <start tag='bar'><![CDATA[ printf("bar batt: (%s) batt2: (%s) batt3: (%s)\n", {batt}, {batt2}, {batt3}); ]]></start> <end tag='bar'><![CDATA[ printf("bar pcdata: %s\n", {#PCDATA}); ]]></end> <end tag='foo'><![CDATA[ printf("foo pcdata: %s\n", {#PCDATA}); ]]></end> <main><![CDATA[ int main(int argc, char **argv) { int retval = yylex(); printf("retval = %d\n", retval); return retval; } ]]></main> </actions> Index: Makefile =================================================================== RCS file: /cvsroot/flexml/flexml/testbed/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile 23 Aug 2006 16:18:43 -0000 1.4 +++ Makefile 24 Aug 2006 20:22:57 -0000 1.5 @@ -26,7 +26,7 @@ # Compares test.out.std[out,err] with expected values COMPARE_OUT = $(MAKEUTILS_DIR)/CompareOut.pl -CC = /usr/bin/gcc-3.3 -Wall -ansi +CC = /usr/bin/gcc-3.3 -Wall CFLAGS = -O2 -g #FLEXDEBUG = -d @@ -39,13 +39,14 @@ # test definitions -- add new tests here ##################################################### -EXES = mixed1 mixed-stratt mixed-enumatt +EXES = mixed1 mixed-enumatt mixed-stratt mixed-stratt-def INTERMEDIATES = $(EXES) $(EXES:%=%.c) $(EXES:%=%.l) UNIT_TESTS = \ test_mixed1 \ + test_mixed-enumatt \ test_mixed-stratt \ - test_mixed-enumatt + test_mixed-stratt-def test : $(UNIT_TESTS) @@ -54,33 +55,31 @@ test_mixed1_cmd = ./mixed1 < mixed1.in test_mixed1_deps = mixed1 mixed1.in -# Test mixed-stratt (mixed content + string attribute) -test_mixed-stratt_cmd = ./mixed-stratt < mixed-stratt.in -test_mixed-stratt_deps = mixed-stratt mixed-stratt.in - # Test mixed-enumatt (mixed content + enumerated attribute) test_mixed-enumatt_cmd = ./mixed-enumatt < mixed-enumatt.in test_mixed-enumatt_deps = mixed-enumatt mixed-enumatt.in -##################################################### -# test build rules -- add new build rules here -##################################################### +# Test mixed-stratt (mixed content + string attribute) +test_mixed-stratt_cmd = ./mixed-stratt < mixed-stratt.in +test_mixed-stratt_deps = mixed-stratt mixed-stratt.in +# Test mixed-stratt (mixed content + default string attribute) +test_mixed-stratt-def_cmd = ./mixed-stratt-def < mixed-stratt-def.in +test_mixed-stratt-def_deps = mixed-stratt-def mixed-stratt-def.in -mixed1: mixed1.dtd mixed1.act - $(FLEXML) -b 1000 -A -amixed1.act mixed1.dtd - $(FLEX) -s -L -t mixed1.l > mixed1.c - $(CC) $(CFLAGS) -o $@ mixed1.c +% : %.dtd %.act + $(FLEXML) -b 1000 -A -a$@.act $@.dtd + $(FLEX) -s -L -o$@.c $@.l + $(CC) $(CFLAGS) -o $@ $@.c -mixed-stratt: mixed-stratt.dtd mixed-stratt.act - $(FLEXML) -b 1000 -A -amixed-stratt.act mixed-stratt.dtd - $(FLEX) -s -L -t mixed-stratt.l > mixed-stratt.c - $(CC) $(CFLAGS) -o $@ mixed-stratt.c +############################################################## +# test build rules -- add override build rules here if needed +############################################################## -mixed-enumatt: mixed-enumatt.dtd mixed-enumatt.act - $(FLEXML) -b 1000 -A -amixed-enumatt.act mixed-enumatt.dtd - $(FLEX) -s -L -t mixed-enumatt.l > mixed-enumatt.c - $(CC) $(CFLAGS) -o $@ mixed-enumatt.c +#mixed1: mixed1.dtd mixed1.act +# $(FLEXML) -b 500 -A -amixed1.act mixed1.dtd +# $(FLEX) -s -L -o mixed1.c mixed1.l > mixed1.c +# $(CC) $(CFLAGS) -o $@ mixed1.c ##################################################### --- NEW FILE: mixed-stratt-def.stdout.expected --- bar batt: (default value) batt2: (second default value) batt3: (third default value) bar pcdata: bar data 1 bar batt: (default value) batt2: ( non-default 2) batt3: (third default value) bar pcdata: bar data 2 bar batt: (default value) batt2: (second default value) batt3: (non-default with single-quote(')) bar pcdata: bar data 3 foo pcdata: 012 cdefghijklmn retval = 0 --- NEW FILE: mixed-stratt-def.in --- <!DOCTYPE foo SYSTEM "mixed-stratt-def.dtd"> <foo>012 <bar>bar data 1</bar> <bar batt2=' non-default 2'>bar data 2</bar> <bar batt3 = "non-default with single-quote(')">bar data 3</bar> cdefghijklmn</foo> |
From: William D. <wdo...@us...> - 2006-08-24 20:22:24
|
Update of /cvsroot/flexml/flexml In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv22541 Modified Files: flexml.pl skel Log Message: Fix bug #1529930 (parsing mixed content fails on sparc/solaris); replace static bufferstack by dynamic (bufferstack,indexstack) pair, so former char* pointers are now integer indices; replace stack-size option by stack-increment; quiet perl warnings when $debug is on; compute and output FLEXML_NEED_BUFFERLIT symbol to quiet compiler warning if bufferliteral() is unused; replace several A_* variables and pcdata by AX_* and pcdata_ix since we are now using indices. Index: skel =================================================================== RCS file: /cvsroot/flexml/flexml/skel,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- skel 15 Aug 2006 16:01:13 -0000 1.33 +++ skel 24 Aug 2006 20:22:21 -0000 1.34 @@ -1,8 +1,8 @@ /* Flex(1) XML processor skeleton scanner (in -*-C-*-). - * Copyright (c) 1999 Kristoffer Rose. All rights reserved. + * Copyright © 1999 Kristoffer Rose. All rights reserved. * * This file is part of the FleXML XML processor generator system. - * Copyright (c) 1999 Kristoffer Rose. All rights reserved. + * Copyright © 1999 Kristoffer Rose. All rights reserved. * * 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 @@ -36,6 +36,10 @@ #include <stdarg.h> #include <ctype.h> +#ifndef FLEXML_INDEXSTACKSIZE +#define FLEXML_INDEXSTACKSIZE 1000 +#endif + /* Generated definitions. */ FLEXML_DEFINITIONS @@ -59,54 +63,90 @@ #define FAIL return fail static int fail(const char*, ...); -const char * parse_err_msg(void); + +enum {flexml_max_err_msg_size = 512}; +static char flexml_err_msg[flexml_max_err_msg_size]; +const char * parse_err_msg() +{ + return flexml_err_msg; +} +static void reset_parse_err_msg() +{ + flexml_err_msg[0] = '\0'; +} /* Cleanup */ static void cleanup(void); #define CLEANUP cleanup() /* Text buffer stack handling. */ -static char bufferstack[FLEXML_BUFFERSTACKSIZE]; -static char* limit = bufferstack + FLEXML_BUFFERSTACKSIZE; -typedef struct BufferLast_s { - struct BufferLast_s *old; const char* saved; char new1[1]; -} BufferLast; -static BufferLast* last = (BufferLast*)0; -static char* next = bufferstack; +char *bufferstack = NULL; +static int blimit = FLEXML_BUFFERSTACKSIZE; +static int bnext = 1; -#define BUFFERSET(P) (P = next) -#define BUFFERPUTC(C) (assert(next<limit), *(next++) = (C)) +static int *indexstack = NULL; +static int ilimit = FLEXML_INDEXSTACKSIZE; +static int inext = 1; + +#define BUFFERSET(P) (P = bnext) +#define BUFFERPUTC(C) (ck_blimit(), bufferstack[bnext++] = (C)) #define BUFFERDONE (BUFFERPUTC('\0')) -#define BUFFERLITERAL(C,P) bufferliteral(C,&(P),yytext) -static void bufferliteral(char c, const char** pp, char* text) +#define BUFFERLITERAL(C, P) bufferliteral(C, &(P), yytext) + +/* after this is called, there are at least 2 slots left in the stack */ +static int ck_blimit() { - char *s = strchr(text,c), *e = strrchr(text,c); + if (bnext >= blimit) { + blimit += FLEXML_BUFFERSTACKSIZE + 2; + { + char *temp = (char *) realloc(bufferstack, blimit); + assert(temp); + bufferstack = temp; + } + } + return 0; +} + +/* after this is called, there are at least 2 slots left in the stack */ +static int ck_ilimit() +{ + if (inext >= ilimit) { + ilimit += FLEXML_INDEXSTACKSIZE + 2; + { + int *temp = (int *) realloc(indexstack, ilimit); + assert(temp); + indexstack = temp; + } + } + return 0; +} + +#ifdef FLEXML_NEED_BUFFERLIT +static void bufferliteral(char c, int* pp, char* text) +{ + char *s = (c ? strchr(text,c) : text-1), *e = strrchr(text,c); assert(s <= e); BUFFERSET(*pp); while (++s<e) { - if (isspace(*s)) { BUFFERPUTC(' '); while (isspace(*s)) ++s; } + if (isspace(*s) && c) { BUFFERPUTC(' '); while (isspace(*s)) ++s; } else BUFFERPUTC(*s); } BUFFERDONE; } +#endif -static void pushbuffer(const char* p) +static void pushbuffer(int p) { - BufferLast* l = (BufferLast*)next; - assert(next < limit); - l->old = last; - l->saved = p; - next = l->new1; - last = l; + ck_ilimit(); + indexstack[inext++] = p; + indexstack[inext++] = bnext; } -static const char* popbuffer(void) +static int popbuffer(void) { - BufferLast* l = last; - assert(last != (BufferLast*)0); - last = l->old; - next = (char*)l; - return l->saved; + assert(inext >= 2); + bnext = indexstack[--inext]; + return indexstack[--inext]; } /* General internal entities are `unput' back onto the input stream... */ @@ -169,14 +209,22 @@ /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ SET(PROLOG); + reset_parse_err_msg(); + bufferstack = (char *) malloc(FLEXML_BUFFERSTACKSIZE); + assert(bufferstack); #ifdef FLEX_DEBUG { int i; - for (i = 0; i < FLEXML_BUFFERSTACKSIZE; i++) { + for (i = 0; i < blimit; i++) { bufferstack[i] = '\377'; } } #endif + bufferstack[0] = '\0'; + indexstack = (int *) malloc(FLEXML_INDEXSTACKSIZE * sizeof(int)); + assert(indexstack); + indexstack[0] = 0; + FLEXML_EXTRA_DEFINITIONS_INIT /* COMMENTS and PIs: handled uniformly for efficiency. */ @@ -306,7 +354,7 @@ { int i; fputs("Buffer: ", stderr); - for (i = 0; i < FLEXML_BUFFERSTACKSIZE; i++) { + for (i = 0; i < blimit; i++) { if ( bufferstack[i] == '\377' ) break; putc(bufferstack[i], stderr); } @@ -322,7 +370,10 @@ } static void debug_leave(void) { - if (yy_flex_debug) print_yy_stack("--LEAVE : "); + if (yy_flex_debug) { + print_yy_stack("--LEAVE : "); + print_bufferstack(); + } yy_pop_state(); } @@ -332,19 +383,6 @@ } #endif -enum {flexml_max_err_msg_size = 512}; - -static char flexml_err_msg[flexml_max_err_msg_size]; -const char * parse_err_msg() -{ - return flexml_err_msg; -} - -static void reset_parse_err_msg() -{ - flexml_err_msg[0] = '\0'; -} - static void cleanup(void) { @@ -352,6 +390,11 @@ free(statenames); statenames = NULL; } + free(bufferstack); + bufferstack = NULL; + + free(indexstack); + indexstack = NULL; } Index: flexml.pl =================================================================== RCS file: /cvsroot/flexml/flexml/flexml.pl,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- flexml.pl 15 Aug 2006 16:01:13 -0000 1.55 +++ flexml.pl 24 Aug 2006 20:22:20 -0000 1.56 @@ -246,12 +246,22 @@ sub api_data { # Print XML application interface parameters. - my ($pre) = @_; + my ($pre) = @_; # pre should be a storage class spec like 'static' or 'extern' print "/* FleXML-provided data. */\n"; - print $pre . "const char* ${tagprefix}pcdata;\n"; + print $pre . "int ${tagprefix}pcdata_ix;\n"; + print "extern char *bufferstack;\n"; + print "#define ${tagprefix}pcdata (bufferstack + ${tagprefix}pcdata_ix)\n"; + for (keys %atttype) { if (m.($Nmtoken)[/]($Nmtoken).xo) { - print $pre . "AT_${tagprefix}$ctag{$1}_$catt{$2} A_${tagprefix}$ctag{$1}_$catt{$2};\n"; + print $pre . "AT_${tagprefix}$ctag{$1}_$catt{$2} AX_${tagprefix}$ctag{$1}_$catt{$2};\n"; + print "#define A_${tagprefix}$ctag{$1}_$catt{$2} "; + if ($enumtype{$_}) { + print "AX_${tagprefix}$ctag{$1}_$catt{$2}\n"; + } + else { + print "(bufferstack + AX_${tagprefix}$ctag{$1}_$catt{$2})\n"; + } } } } @@ -312,6 +322,16 @@ # } } +# add attribute to list of all default attributes +my @default_attributes; +my $next_att_loc = 1; +sub add_def_att { + my ($att) = @_; + my $retval = $next_att_loc; + push @default_attributes, ($att); + $next_att_loc += length($att) + 1; + return $retval; +} sub nextline { # return one input line @@ -500,7 +520,7 @@ # Parse options. $Use = "Usage: flexml [-ASHDvdqnLXV] [-s skel] [-T actbin] [--sysid sysid] [-p pubid] [-u uri]\n" - . " [-b stack_size] [-r roottags] [-a actions] [-P prefix] name[.dtd]"; + . " [-b stack_increment] [-r roottags] [-a actions] [-P prefix] name[.dtd]"; sub show_version { @@ -532,7 +552,7 @@ }, # Specific stack size? - "stack-size|b=s" => \$stacksize, + "stack-increment|b=s" => \$stacksize, # Specific tagprefix? "tag-prefix|P=s" => sub { $tagprefix = $_[1]."_" }, @@ -846,12 +866,12 @@ } # ...and string/token types. else { - $typeof{"$tag/$attribute"} = 'const char*'; + $typeof{"$tag/$attribute"} = 'int'; if ($default) { - $initof{"$tag/$attribute"} = "\"$default\""; + $initof{"$tag/$attribute"} = add_def_att($default); } else { - $initof{"$tag/$attribute"} = 'NULL'; + $initof{"$tag/$attribute"} = '0'; } # Special treatment of token types. @@ -1053,32 +1073,32 @@ } # display the options we got - print "debug=$debug\n"; - print "verbose=$verbose\n"; - print "quiet=$quiet_parser\n"; - - print "dry-run=$dryrun\n"; - print "lineno=$lineno\n"; - - print "nofail=$nofail\n"; - - print "stack-size=$stacksize\n"; - print "tag-prefix=$tagprefix\n"; - - print "act-bin=$actbin\n"; - - print "skel=$SKELETON\n"; - - print "uri=$uri\n"; - print "pubid=$pubid\n\n"; - print "sysid=$sysid\n\n"; + print "debug=".($debug||'undef')."\n"; + print "verbose=".($verbose||'undef')."\n"; + print "quiet=".($quiet_parser||'undef')."\n"; + + print "dry-run=".($dryrun||'undef')."\n"; + print "lineno=".($lineno||'undef')."\n"; + + print "nofail=".($nofail||'undef')."\n"; + + print "stack-increment=".($stacksize||'undef')."\n"; + print "tag-prefix=".($tagprefix||'undef')."\n"; + + print "act-bin=".($actbin||'undef')."\n"; + + print "skel=".($SKELETON||'undef')."\n"; + + print "uri=".($uri||'undef')."\n"; + print "pubid=".($pubid||'undef')."\n\n"; + print "sysid=".($sysid||'undef')."\n\n"; print "header=".($header||'undef')."\n"; print "dummy=".($dummy||'undef')."\n"; print "stand-alone=".($standalone||'undef')."\n"; print "scanner=".($scanner||'undef')."\n"; print "actions=".($actions||'undef')."\n\n"; - + print '%source = (' . printhash(\%source) . ")\n"; print "\n"; @@ -1215,7 +1235,11 @@ print "#define FLEXML_yylineno\n" if $lineno; print "#define FLEXML_NOFAIL\n" if $nofail; print "#define FLEXML_quiet_parser\n" if $quiet_parser; + print "#ifndef FLEXML_BUFFERSTACKSIZE\n"; print "#define FLEXML_BUFFERSTACKSIZE $stacksize\n"; + print "#endif\n"; + print "#define FLEXML_NEED_BUFFERLIT\n" + if (scalar(%literaltype) or ($#default_attributes >= 0)); print "\n"; if ($standalone) { @@ -1263,7 +1287,9 @@ my ($state, $tag); print " /* FleXML_init */\n"; - print " next = bufferstack;\n"; + for my $att (@default_attributes) { + print " bufferliteral('\\0', &bnext, \"$att\");\n"; + } print " if(!${tagprefix}statenames) {${tagprefix}statenames= (const char **)calloc(IMPOSSIBLE,sizeof(char*));\n"; for ('PROLOG','DOCTYPE','EPILOG','INCOMMENT','INPI','VALUE1','VALUE2','CDATA') { print " ${tagprefix}statenames[$_] = NULL;\n"; @@ -1349,9 +1375,9 @@ print ">\"<$tag\"{s} {\n"; for my $attribute (@myattributes) { - print " A_${tagprefix}${myctag}_$catt{$attribute} = " . $initof{"$tag/$attribute"} . ";\n"; + print " AX_${tagprefix}${myctag}_$catt{$attribute} = " . $initof{"$tag/$attribute"} . ";\n"; } - print " ENTER(AL_${tagprefix}$myctag); pushbuffer(NULL);\n"; + print " ENTER(AL_${tagprefix}$myctag); pushbuffer(0);\n"; print " }\n"; # print " . FAIL(\"Unexpected character `%c': `<$tag' expected.\",yytext[0]);\n"; @@ -1394,23 +1420,23 @@ print " \"$attribute\"{Eq}\"'" . $attdef{"$tag/$attribute"} . "'\"" . " |\n" . " \"$attribute\"{Eq}\"\\\"" . $attdef{"$tag/$attribute"} . "\\\"\"" - . " A_${tagprefix}${myctag}_$catt{$attribute}" + . " AX_${tagprefix}${myctag}_$catt{$attribute}" . " = " . $initof{"$tag/$attribute"} . ";\n"; } elsif ($type = $literaltype{"$tag/$attribute"}) { # - (non-fixed) literal-type attribute: scan literal string directly, or - print " \"$attribute\"{Eq}\'$type\' BUFFERLITERAL('\\\'',A_${tagprefix}${myctag}_$catt{$attribute});\n"; + print " \"$attribute\"{Eq}\'$type\' BUFFERLITERAL('\\\'',AX_${tagprefix}${myctag}_$catt{$attribute});\n"; - print " \"$attribute\"{Eq}\\\"$type\\\" BUFFERLITERAL('\"',A_${tagprefix}${myctag}_$catt{$attribute});\n"; + print " \"$attribute\"{Eq}\\\"$type\\\" BUFFERLITERAL('\"',AX_${tagprefix}${myctag}_$catt{$attribute});\n"; } else { # - (non-fixed non-literal) attribute: scan string with entity expansion. - print " \"$attribute\"{Eq}\\' ENTER(VALUE1); BUFFERSET(A_${tagprefix}${myctag}_$catt{$attribute});\n"; - print " \"$attribute\"{Eq}\\\" ENTER(VALUE2); BUFFERSET(A_${tagprefix}${myctag}_$catt{$attribute});\n"; + print " \"$attribute\"{Eq}\\' ENTER(VALUE1); BUFFERSET(AX_${tagprefix}${myctag}_$catt{$attribute});\n"; + print " \"$attribute\"{Eq}\\\" ENTER(VALUE2); BUFFERSET(AX_${tagprefix}${myctag}_$catt{$attribute});\n"; } print "\n"; @@ -1426,8 +1452,8 @@ } } print " LEAVE; STag_${tagprefix}$myctag(); popbuffer(); " - . (%inmixed ? ' pushbuffer('."${tagprefix}".'pcdata);' : '') - . ($mixed{$tag} ? 'pushbuffer('."${tagprefix}".'pcdata); BUFFERSET('."${tagprefix}".'pcdata);' : "${tagprefix}".'pcdata = NULL'). ";" + . (%inmixed ? ' pushbuffer('."${tagprefix}".'pcdata_ix);' : '') + . ($mixed{$tag} ? 'pushbuffer('."${tagprefix}".'pcdata_ix); BUFFERSET('."${tagprefix}".'pcdata_ix);' : "${tagprefix}".'pcdata_ix = 0'). ";" . " ENTER($startstate{$tag});\n"; print " }\n"; # @@ -1441,10 +1467,10 @@ } } print " LEAVE; STag_${tagprefix}$myctag(); popbuffer();" - . (%inmixed ? ' pushbuffer('."${tagprefix}".'pcdata);' : '') - . " ${tagprefix}".'pcdata = ' . ($mixed{$tag} ? '""' : 'NULL') . ';' + . (%inmixed ? ' pushbuffer('."${tagprefix}".'pcdata_ix);' : '') + . " ${tagprefix}".'pcdata_ix = 0;' . " ETag_${tagprefix}$myctag();" - . (%inmixed ? " ${tagprefix}".'pcdata = popbuffer();' : '') + . (%inmixed ? " ${tagprefix}".'pcdata_ix = popbuffer();' : '') . "\n"; # print $exitswitch; @@ -1469,8 +1495,8 @@ print " LEAVE;\n"; print " BUFFERDONE;\n" if $mixed{$tag}; print " ETag_${tagprefix}$myctag();\n"; - print " ${tagprefix}pcdata = popbuffer();\n" if $mixed{$tag}; - print " ${tagprefix}pcdata = popbuffer();\n" if %inmixed; + print " ${tagprefix}pcdata_ix = popbuffer();\n" if $mixed{$tag}; + print " ${tagprefix}pcdata_ix = popbuffer();\n" if %inmixed; print $exitswitch; print " }\n"; @@ -1845,11 +1871,10 @@ This is an internal option mainly used to test versions of flexml not installed yet. -=item B<--stack-size> I<stack_size>, B<-b> I<stack_size> +=item B<--stack-increment> I<stack_increment>, B<-b> I<stack_increment> -Sets the FLEXML_BUFFERSTACKSIZE to stack_size (100000 by default). Use -this option when you get an error like "Assertion `next<limit' -failed". +Sets the FLEXML_BUFFERSTACKSIZE to stack_increment (100000 by default). This +controls how much the data stack grows in each realloc(). =item B<--tag-prefix> I<STRING>, B<-O> I<STRING> @@ -2016,11 +2041,6 @@ =item * -The XML processor currently uses a fixed-size buffer to read -C<pcdata>. It should not. - -=item * - The DTD parser is presently a perl hack so it may parse some DTDs badly; in particular the expansion of parameter entities may not conform fully to the XML specification. |
From: William D. <wdo...@us...> - 2006-08-24 20:22:04
|
Update of /cvsroot/flexml/flexml In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv22163 Modified Files: flexml-act-bootstrap.c Log Message: Need extern decl for bufferstack, since symbols like A_start_tag are #defines that refer to bufferstack. Index: flexml-act-bootstrap.c =================================================================== RCS file: /cvsroot/flexml/flexml/flexml-act-bootstrap.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- flexml-act-bootstrap.c 18 Jul 2006 18:21:13 -0000 1.8 +++ flexml-act-bootstrap.c 24 Aug 2006 20:21:59 -0000 1.9 @@ -24,6 +24,7 @@ #include <unistd.h> #include "flexml-act.h" +extern char *bufferstack; extern FILE* yyin; extern int yylineno; extern int yylex(void); |
From: Martin Q. <mqu...@us...> - 2006-08-23 16:24:02
|
Update of /cvsroot/flexml/flexml In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv28715 Modified Files: Makefile Log Message: Also add the new testbed into the tarballs Index: Makefile =================================================================== RCS file: /cvsroot/flexml/flexml/Makefile,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- Makefile 23 Aug 2006 16:19:17 -0000 1.41 +++ Makefile 23 Aug 2006 16:23:59 -0000 1.42 @@ -70,7 +70,7 @@ mkdir $(FLEXML_DISTDIR) cp $(STUFF) $(DATA) $(DOCS) $(HTMLS) flexml-act-bootstrap.c \ $(FLEXML_DISTDIR) - cp -r examples $(FLEXML_DISTDIR) + cp -r examples testbed $(FLEXML_DISTDIR) find $(FLEXML_DISTDIR) -name CVS | xargs rm -rf find $(FLEXML_DISTDIR) -name .cvsignore | xargs rm -rf tar cvfz $(FLEXML_DISTDIR).tar.gz $(FLEXML_DISTDIR) |
From: Martin Q. <mqu...@us...> - 2006-08-23 16:19:21
|
Update of /cvsroot/flexml/flexml In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv27058 Modified Files: Makefile Log Message: Also run the new testsuite when asked to autotest Index: Makefile =================================================================== RCS file: /cvsroot/flexml/flexml/Makefile,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- Makefile 18 Jul 2006 18:21:13 -0000 1.40 +++ Makefile 23 Aug 2006 16:19:17 -0000 1.41 @@ -131,8 +131,8 @@ # TESTS. -clean::; make -C examples $@ -test::; make -C examples $@ +clean::; make -C examples $@; make -C testbed $@ +test::; make -C examples $@; make -C testbed $@ # END. |
From: William D. <wdo...@us...> - 2006-08-23 16:18:46
|
Update of /cvsroot/flexml/flexml/testbed In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv26672 Modified Files: Makefile Added Files: mixed-enumatt.act mixed-enumatt.dtd mixed-enumatt.in mixed-enumatt.stdout.expected Log Message: Add new test for dtds with enumenrated attributes. --- NEW FILE: mixed-enumatt.act --- <!DOCTYPE actions SYSTEM "flexml-act.dtd"> <actions> <top><![CDATA[ #include "stdio.h" ]]></top> <start tag='reqatt'><![CDATA[ printf("reqatt att: (%s)\n", {att} == {att=val1} ? "val1" : {att} == {att=val2} ? "val2" : {att} == {!att} ? "no att given" : "error in attribute"); ]]></start> <start tag='defatt'><![CDATA[ printf("defatt att: (%s)\n", {att} == {att=val1} ? "val1" : {att} == {att=val2} ? "val2" : {att} == {!att} ? "no att given" : "error in attribute"); ]]></start> <start tag='optatt'><![CDATA[ printf("optatt att: (%s)\n", {att} == {att=val1} ? "val1" : {att} == {att=val2} ? "val2" : {att} == {!att} ? "no att given" : "error in attribute"); ]]></start> <end tag='reqatt'><![CDATA[ printf("reqatt pcdata: %s\n", {#PCDATA}); ]]></end> <end tag='defatt'><![CDATA[ printf("defatt pcdata: %s\n", {#PCDATA}); ]]></end> <end tag='optatt'><![CDATA[ printf("optatt pcdata: %s\n", {#PCDATA}); ]]></end> <end tag='foo'><![CDATA[ printf("foo pcdata: %s\n", {#PCDATA}); ]]></end> <main><![CDATA[ int main(int argc, char **argv) { int retval = yylex(); printf("retval = %d\n", retval); return retval; } ]]></main> </actions> --- NEW FILE: mixed-enumatt.in --- <!DOCTYPE foo SYSTEM "mixed-enumatt.dtd"> <foo>foo start data <reqatt att="val1">reqatt data</reqatt> <defatt att="val1">defatt data</defatt> <defatt>defatt data</defatt> <optatt att="val1">optatt data</optatt> <optatt>optatt data</optatt> foo end data.</foo> Index: Makefile =================================================================== RCS file: /cvsroot/flexml/flexml/testbed/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile 21 Aug 2006 18:27:30 -0000 1.3 +++ Makefile 23 Aug 2006 16:18:43 -0000 1.4 @@ -30,7 +30,7 @@ CFLAGS = -O2 -g #FLEXDEBUG = -d -FLEXML = ../flexml -s ../skel +FLEXML = ../flexml -s ../skel -T../flexml-act .PHONY : test .PHONY : clean @@ -39,12 +39,13 @@ # test definitions -- add new tests here ##################################################### -EXES = mixed1 mixed-stratt +EXES = mixed1 mixed-stratt mixed-enumatt INTERMEDIATES = $(EXES) $(EXES:%=%.c) $(EXES:%=%.l) UNIT_TESTS = \ test_mixed1 \ - test_mixed-stratt + test_mixed-stratt \ + test_mixed-enumatt test : $(UNIT_TESTS) @@ -57,6 +58,10 @@ test_mixed-stratt_cmd = ./mixed-stratt < mixed-stratt.in test_mixed-stratt_deps = mixed-stratt mixed-stratt.in +# Test mixed-enumatt (mixed content + enumerated attribute) +test_mixed-enumatt_cmd = ./mixed-enumatt < mixed-enumatt.in +test_mixed-enumatt_deps = mixed-enumatt mixed-enumatt.in + ##################################################### # test build rules -- add new build rules here ##################################################### @@ -72,6 +77,11 @@ $(FLEX) -s -L -t mixed-stratt.l > mixed-stratt.c $(CC) $(CFLAGS) -o $@ mixed-stratt.c +mixed-enumatt: mixed-enumatt.dtd mixed-enumatt.act + $(FLEXML) -b 1000 -A -amixed-enumatt.act mixed-enumatt.dtd + $(FLEX) -s -L -t mixed-enumatt.l > mixed-enumatt.c + $(CC) $(CFLAGS) -o $@ mixed-enumatt.c + ##################################################### # test infrastructure -- do not modify for new tests --- NEW FILE: mixed-enumatt.stdout.expected --- reqatt att: (val1) reqatt pcdata: reqatt data defatt att: (val1) defatt pcdata: defatt data defatt att: (val2) defatt pcdata: defatt data optatt att: (val1) optatt pcdata: optatt data optatt att: (no att given) optatt pcdata: optatt data foo pcdata: foo start data foo end data. retval = 0 --- NEW FILE: mixed-enumatt.dtd --- <!ELEMENT foo (#PCDATA|reqatt|defatt|optatt)*> <!ELEMENT reqatt (#PCDATA)> <!ATTLIST reqatt att (val1 | val2 ) #REQUIRED> <!ELEMENT defatt (#PCDATA)> <!ATTLIST defatt att (val1 | val2 ) 'val2'> <!ELEMENT optatt (#PCDATA)> <!ATTLIST optatt att (val1 | val2 ) #IMPLIED> |
From: William D. <wdo...@us...> - 2006-08-23 16:17:57
|
Update of /cvsroot/flexml/flexml/testbed In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv26269 Modified Files: mixed-stratt.act mixed1.act Log Message: Use {#PCDATA} not pcdata in .act files. Index: mixed1.act =================================================================== RCS file: /cvsroot/flexml/flexml/testbed/mixed1.act,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mixed1.act 21 Aug 2006 16:09:32 -0000 1.1 +++ mixed1.act 23 Aug 2006 16:17:50 -0000 1.2 @@ -6,12 +6,12 @@ ]]></top> <end tag='bar'><![CDATA[ - printf("bar pcdata: %s\n", pcdata); + printf("bar pcdata: %s\n", {#PCDATA}); ]]></end> <end tag='foo'><![CDATA[ - printf("foo pcdata: %s\n", pcdata); + printf("foo pcdata: %s\n", {#PCDATA}); ]]></end> Index: mixed-stratt.act =================================================================== RCS file: /cvsroot/flexml/flexml/testbed/mixed-stratt.act,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- mixed-stratt.act 21 Aug 2006 18:24:23 -0000 1.1 +++ mixed-stratt.act 23 Aug 2006 16:17:50 -0000 1.2 @@ -11,12 +11,12 @@ <end tag='bar'><![CDATA[ - printf("bar pcdata: %s\n", pcdata); + printf("bar pcdata: %s\n", {#PCDATA}); ]]></end> <end tag='foo'><![CDATA[ - printf("foo pcdata: %s\n", pcdata); + printf("foo pcdata: %s\n", {#PCDATA}); ]]></end> |
From: Martin Q. <mqu...@us...> - 2006-08-22 14:00:47
|
Update of /cvsroot/flexml/flexml In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv7814 Modified Files: Makefile.defs Log Message: Document last William's changes, and prepare for the 1.6 release Index: Makefile.defs =================================================================== RCS file: /cvsroot/flexml/flexml/Makefile.defs,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Makefile.defs 21 Aug 2006 16:11:20 -0000 1.11 +++ Makefile.defs 22 Aug 2006 14:00:37 -0000 1.12 @@ -6,7 +6,7 @@ #SUFF ?=-$(VER) SUFF ?= -VER = 1.5.3 +VER = 1.6 # SETUP. |
From: Martin Q. <mqu...@us...> - 2006-08-22 14:00:45
|
Update of /cvsroot/flexml/flexml/debian In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv7814/debian Modified Files: changelog Log Message: Document last William's changes, and prepare for the 1.6 release Index: changelog =================================================================== RCS file: /cvsroot/flexml/flexml/debian/changelog,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- changelog 18 Jul 2006 19:12:57 -0000 1.27 +++ changelog 22 Aug 2006 14:00:37 -0000 1.28 @@ -1,3 +1,15 @@ +flexml (1.6-1) unstable; urgency=low + + [William Dowling] + * Fix bug 1538171: Only display the stacknames when they are defined (they + are not in the prolog) + * Fix a bufferstack memleak. This fixes both leaks of attributes and leaks + of pcdata. People using large XML files shouldn't have to use insane + buffsizes anymore. + * Add a proper regression testing infrastructure. + + -- Martin Quinson <mqu...@de...> Tue, 22 Aug 2006 15:59:31 +0200 + flexml (1.5.3-1) unstable; urgency=low * New option: --sysid to override the system id |
From: William D. <wdo...@us...> - 2006-08-21 18:27:33
|
Update of /cvsroot/flexml/flexml/testbed In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv26109 Modified Files: Makefile Log Message: Fix FLEXML defn. Index: Makefile =================================================================== RCS file: /cvsroot/flexml/flexml/testbed/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 21 Aug 2006 18:22:40 -0000 1.2 +++ Makefile 21 Aug 2006 18:27:30 -0000 1.3 @@ -30,7 +30,7 @@ CFLAGS = -O2 -g #FLEXDEBUG = -d -FLEXML = /proj/flexml/flexml-from-cvs-20060821/flexml -s /proj/flexml/flexml-from-cvs-20060821/skel +FLEXML = ../flexml -s ../skel .PHONY : test .PHONY : clean |
From: William D. <wdo...@us...> - 2006-08-21 18:24:25
|
Update of /cvsroot/flexml/flexml/testbed In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv24890 Added Files: mixed-stratt.act mixed-stratt.in mixed-stratt.dtd mixed-stratt.stdout.expected Log Message: Add test of dtd w/ mixed content plus a string attribute. --- NEW FILE: mixed-stratt.in --- <!DOCTYPE foo SYSTEM "mixed-stratt.dtd"> <foo>012<bar batt="batt1">456789ab</bar>cdefghijklmn</foo> --- NEW FILE: mixed-stratt.act --- <!DOCTYPE actions SYSTEM "flexml-act.dtd"> <actions> <top><![CDATA[ #include "stdio.h" ]]></top> <start tag='bar'><![CDATA[ printf("bar att: %s\n", {batt}); ]]></start> <end tag='bar'><![CDATA[ printf("bar pcdata: %s\n", pcdata); ]]></end> <end tag='foo'><![CDATA[ printf("foo pcdata: %s\n", pcdata); ]]></end> <main><![CDATA[ int main(int argc, char **argv) { int retval = yylex(); printf("retval = %d\n", retval); return retval; } ]]></main> </actions> --- NEW FILE: mixed-stratt.stdout.expected --- bar att: batt1 bar pcdata: 456789ab foo pcdata: 012cdefghijklmn retval = 0 --- NEW FILE: mixed-stratt.dtd --- <!ELEMENT foo (#PCDATA|bar)*> <!ELEMENT bar (#PCDATA)> <!ATTLIST bar batt CDATA #REQUIRED> |
From: William D. <wdo...@us...> - 2006-08-21 18:22:43
|
Update of /cvsroot/flexml/flexml/testbed In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv24077 Modified Files: Makefile Log Message: Add test of dtd w/ mixed content plus a string attribute. Index: Makefile =================================================================== RCS file: /cvsroot/flexml/flexml/testbed/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile 21 Aug 2006 16:09:32 -0000 1.1 +++ Makefile 21 Aug 2006 18:22:40 -0000 1.2 @@ -39,11 +39,12 @@ # test definitions -- add new tests here ##################################################### -EXES = mixed1 +EXES = mixed1 mixed-stratt INTERMEDIATES = $(EXES) $(EXES:%=%.c) $(EXES:%=%.l) UNIT_TESTS = \ - test_mixed1 + test_mixed1 \ + test_mixed-stratt test : $(UNIT_TESTS) @@ -52,6 +53,10 @@ test_mixed1_cmd = ./mixed1 < mixed1.in test_mixed1_deps = mixed1 mixed1.in +# Test mixed-stratt (mixed content + string attribute) +test_mixed-stratt_cmd = ./mixed-stratt < mixed-stratt.in +test_mixed-stratt_deps = mixed-stratt mixed-stratt.in + ##################################################### # test build rules -- add new build rules here ##################################################### @@ -62,6 +67,11 @@ $(FLEX) -s -L -t mixed1.l > mixed1.c $(CC) $(CFLAGS) -o $@ mixed1.c +mixed-stratt: mixed-stratt.dtd mixed-stratt.act + $(FLEXML) -b 1000 -A -amixed-stratt.act mixed-stratt.dtd + $(FLEX) -s -L -t mixed-stratt.l > mixed-stratt.c + $(CC) $(CFLAGS) -o $@ mixed-stratt.c + ##################################################### # test infrastructure -- do not modify for new tests |
From: William D. <wdo...@us...> - 2006-08-21 17:33:16
|
Update of /cvsroot/flexml/flexml/testbed In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv4144 Modified Files: CompareOut.pl Log Message: Remove old comments. Index: CompareOut.pl =================================================================== RCS file: /cvsroot/flexml/flexml/testbed/CompareOut.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CompareOut.pl 21 Aug 2006 16:09:32 -0000 1.1 +++ CompareOut.pl 21 Aug 2006 17:33:13 -0000 1.2 @@ -24,42 +24,6 @@ # $Id$ # $Source$ -# $Log$ -# Revision 1.1 2006/08/21 16:09:32 wdowling -# Initial revision: regression testbed. -# -# Revision 1.4 2006/07/14 19:28:41 jye -# Change the hash-bang at the beginning of the perl script -# -# Revision 1.3 2003/11/25 21:07:21 wdowling -# Do comparison of stderr before stdout. (If both are different from -# expected, the stderr file is usually mor informative.) -# -# Revision 1.2 2003/11/18 17:37:28 jaross -# Minor Change to change the string: "failed:" to "failed". Not only is this -# more consistent with the passed string, but it was causing -# errors in the nightly linksadm cronjob: verifybuilds.sh. -# -# Revision 1.1 2003/06/16 20:26:16 rlange -# Moved BuildDepend.pl from liblocal to makeutils. -# Moved CompareOut.pl and hack_swig_output.pl from -# liblocal/scripts to makeutils. -# -# Revision 1.4 2002/06/24 20:45:52 wdowling -# Send output sdterr output from diff command (diff or cmp) to /dev/null. -# -# Revision 1.3 2002/06/18 15:42:23 cliscum -# Add ability to specify comparison program on command line with '-p xxx'. -# -# Revision 1.2 2001/12/07 21:13:42 wdowling -# Accommodate use of diff_opts as 1st command line parameter, and pass -# into system call of diff if present. Print basename in case of passing test. -# -# Revision 1.1 2001/12/06 20:45:12 wdowling -# Initial check. Support module for 'make test'. See -# liblocal/Makefile.{header, trailer} for usage. -# - use strict; use Getopt::Std; |
From: William D. <wdo...@us...> - 2006-08-21 16:11:28
|
Update of /cvsroot/flexml/flexml In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv3801 Modified Files: Makefile.defs Log Message: Add definition of SYMLINK. Index: Makefile.defs =================================================================== RCS file: /cvsroot/flexml/flexml/Makefile.defs,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Makefile.defs 18 Jul 2006 19:12:39 -0000 1.10 +++ Makefile.defs 21 Aug 2006 16:11:20 -0000 1.11 @@ -38,6 +38,7 @@ POD2HTML = $(PERL_DIR)/pod2html FLEX = /usr/bin/flex +SYMLINK = ln -s # Build compilation setup. CC = gcc -Wall -ansi -pedantic |
From: William D. <wdo...@us...> - 2006-08-21 16:09:37
|
Update of /cvsroot/flexml/flexml/testbed In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv2980/testbed Added Files: CompareOut.pl Makefile mixed1.act mixed1.dtd mixed1.in mixed1.stdout.expected Log Message: Initial revision: regression testbed. --- NEW FILE: mixed1.dtd --- <!ELEMENT foo (#PCDATA|bar)*> <!ELEMENT bar (#PCDATA)> <!-- <!ATTLIST bar batt CDATA #REQUIRED> --> --- NEW FILE: mixed1.act --- <!DOCTYPE actions SYSTEM "flexml-act.dtd"> <actions> <top><![CDATA[ #include "stdio.h" ]]></top> <end tag='bar'><![CDATA[ printf("bar pcdata: %s\n", pcdata); ]]></end> <end tag='foo'><![CDATA[ printf("foo pcdata: %s\n", pcdata); ]]></end> <main><![CDATA[ int main(int argc, char **argv) { int retval = yylex(); printf("retval = %d\n", retval); return retval; } ]]></main> </actions> --- NEW FILE: Makefile --- # $Source: /cvsroot/flexml/flexml/testbed/Makefile,v $ # regression testbed Makefile ##################################################### # Fixed definitions -- do not modify for new tests ##################################################### include ../Makefile.defs MAKEUTILS_DIR = . # If UNIT_TESTS is test_foo # and test_foo_out is bar baz # Then the created files (that need to be deleted by 'make clean' # will be # test_foo foo.std{err,out} foo.std{err,out}.diff bar baz bar.diff baz.diff TEST_INTERMEDIATES = \ $(UNIT_TESTS) \ $(UNIT_TESTS:test_%=%.stdout) $(UNIT_TESTS:test_%=%.stdout.diff) \ $(UNIT_TESTS:test_%=.test_%.stdout.expected) \ $(UNIT_TESTS:test_%=%.stderr) $(UNIT_TESTS:test_%=%.stderr.diff) \ $(UNIT_TESTS:test_%=.test_%.stderr.expected) \ $(foreach var,$(UNIT_TESTS:%=%_out),$(foreach o,$($(var)),$o $(o).diff)) # Compares test.out.std[out,err] with expected values COMPARE_OUT = $(MAKEUTILS_DIR)/CompareOut.pl CC = /usr/bin/gcc-3.3 -Wall -ansi CFLAGS = -O2 -g #FLEXDEBUG = -d FLEXML = /proj/flexml/flexml-from-cvs-20060821/flexml -s /proj/flexml/flexml-from-cvs-20060821/skel .PHONY : test .PHONY : clean ##################################################### # test definitions -- add new tests here ##################################################### EXES = mixed1 INTERMEDIATES = $(EXES) $(EXES:%=%.c) $(EXES:%=%.l) UNIT_TESTS = \ test_mixed1 test : $(UNIT_TESTS) # Test mixed1 test_mixed1_cmd = ./mixed1 < mixed1.in test_mixed1_deps = mixed1 mixed1.in ##################################################### # test build rules -- add new build rules here ##################################################### mixed1: mixed1.dtd mixed1.act $(FLEXML) -b 1000 -A -amixed1.act mixed1.dtd $(FLEX) -s -L -t mixed1.l > mixed1.c $(CC) $(CFLAGS) -o $@ mixed1.c ##################################################### # test infrastructure -- do not modify for new tests ##################################################### clean : rm -f $(TEST_INTERMEDIATES) $(INTERMEDIATES) # When we are building test_foo, the variable $(TEST_BASE) is "foo" test_% : TEST_BASE = $(@:test_%=%) ifndef distribute_deps # This will take a target and dependency list, and evaluate each dependency # individually. This only needs to be used on dependency lists that are to # be in an $(eval ...) function. This is a work-around for a bug in GNU Make # 3.80, which fails when $(eval)'ing dependency lists longer than about 160 # characters. # 1. target # 2. dependency list define distribute_deps $(foreach dep,$(2),$(eval $(1) : $(dep))) endef endif define unit_test_deps_t $(1) : .$(1).stdout.expected $(1) : .$(1).stderr.expected $$(call distribute_deps,$(1),$($(1)_deps)) endef $(foreach test,$(UNIT_TESTS),$(eval $(call unit_test_deps_t,$(test)))) # To build .test_foo.std{err,out}.expected -- # If foo.std{err,out}.expected exists, symlink to it # Else, .test_foo.std{err,out}.expected is a new empty file # These rules are invoked from rules in the Extradeps section. # They must be two separate rules (else 'make test' not idempotent # -- see bug #105) .test_%.stderr.expected: @if [ -f $(@:.test_%=%) ]; \ then $(SYMLINK) $(@:.test_%=%) $@; \ else touch $@; \ fi .test_%.stdout.expected: @if [ -f $(@:.test_%=%) ]; \ then $(SYMLINK) $(@:.test_%=%) $@; \ else touch $@; \ fi # Unit test rule. Expects: # UNIT_TESTS = test_foo test_bar (test_ prefix is necessary) # test_foo_cmd = command to run # test_foo_deps = dependencies (i.e. inputs to the test, and the executable) # test_foo_out = files and directories created by running the command # with corresponding .expected files for comparison $(UNIT_TESTS) : @$(test_$(@:test_%=%)_cmd) > $(@:test_%=%).stdout \ 2>$(@:test_%=%).stderr || true @$(PERL) $(COMPARE_OUT) -p '$($(@)_diff_prog)' -- \ $($(@)_diff_opts) $(@:test_%=%) $($(@)_out) | tee $@ --- NEW FILE: mixed1.stdout.expected --- bar pcdata: 456789ab foo pcdata: 012cdefghijklmn retval = 0 --- NEW FILE: mixed1.in --- <!DOCTYPE foo SYSTEM "mixed1.dtd"> <foo>012<bar>456789ab</bar>cdefghijklmn</foo> --- NEW FILE: CompareOut.pl --- #!/usr/bin/env perl # Assume ARGV is ($basename @REST). Print "passed" or "failed" based on the # following comparisons: # Compare $basename.stderr with $basename.stderr.expected # pass if no difference or # $basename.stderr is empty and $basename.stderr.expected doesn't exist; # Compare $basename.stdout with $basename.stdout.expected # pass if no difference or # $basename.stdout is empty and $basename.stdout.expected doesn't exist; # For each file $foo in @REST # Compare $foo with $foo.expected # pass if no difference; # Print "passed" if all tests pass, otherwise print # "failed <file-that-failed>" # NOTES # In order to compare directories, GNU diff must be used. There # should probably be a test to ensure this. # $Id: CompareOut.pl,v 1.1 2006/08/21 16:09:32 wdowling Exp $ # $Source: /cvsroot/flexml/flexml/testbed/CompareOut.pl,v $ # $Log: CompareOut.pl,v $ # Revision 1.1 2006/08/21 16:09:32 wdowling # Initial revision: regression testbed. # # Revision 1.4 2006/07/14 19:28:41 jye # Change the hash-bang at the beginning of the perl script # # Revision 1.3 2003/11/25 21:07:21 wdowling # Do comparison of stderr before stdout. (If both are different from # expected, the stderr file is usually mor informative.) # # Revision 1.2 2003/11/18 17:37:28 jaross # Minor Change to change the string: "failed:" to "failed". Not only is this # more consistent with the passed string, but it was causing # errors in the nightly linksadm cronjob: verifybuilds.sh. # # Revision 1.1 2003/06/16 20:26:16 rlange # Moved BuildDepend.pl from liblocal to makeutils. # Moved CompareOut.pl and hack_swig_output.pl from # liblocal/scripts to makeutils. # # Revision 1.4 2002/06/24 20:45:52 wdowling # Send output sdterr output from diff command (diff or cmp) to /dev/null. # # Revision 1.3 2002/06/18 15:42:23 cliscum # Add ability to specify comparison program on command line with '-p xxx'. # # Revision 1.2 2001/12/07 21:13:42 wdowling # Accommodate use of diff_opts as 1st command line parameter, and pass # into system call of diff if present. Print basename in case of passing test. # # Revision 1.1 2001/12/06 20:45:12 wdowling # Initial check. Support module for 'make test'. See # liblocal/Makefile.{header, trailer} for usage. # use strict; use Getopt::Std; my %args; getopts('p:', \%args); my $diff_prog = $args{'p'} || 'diff'; my $diff_opt = ""; if ($ARGV[0] =~ /^-/) { $diff_opt = shift; } my $basename = shift; my $diff_cmd = "$diff_prog $diff_opt"; my $retcode; my $fail_file; my $made_stdout = 0; my $made_stderr = 0; # Compare basename.stderr to basename.stderr.expected if (! -f "$basename.stderr.expected") { system("touch $basename.stderr.expected"); $made_stderr = 1; } $retcode = system("$diff_cmd $basename.stderr $basename.stderr.expected " . "> $basename.stderr.diff 2>/dev/null"); system("rm -f $basename.stderr.expected") if $made_stderr; $fail_file = "$basename.stderr" if $retcode; # Compare basename.stdout to basename.stdout.expected if ($retcode == 0) { if (! -f "$basename.stdout.expected") { system("touch $basename.stdout.expected"); $made_stdout = 1; } $retcode = system("$diff_cmd $basename.stdout $basename.stdout.expected " . "> $basename.stdout.diff 2>/dev/null"); system("rm -f $basename.stdout.expected") if $made_stdout; $fail_file = "$basename.stdout" if $retcode; } while (($retcode == 0) && @ARGV) { my $file = shift; # compare file with file.expected $retcode = system("$diff_cmd $file $file.expected >$file.diff 2>/dev/null"); $fail_file = $file if $retcode; } print ($retcode ? "failed $fail_file\n" : "passed $basename\n"); |
From: William D. <wdo...@us...> - 2006-08-21 16:07:51
|
Update of /cvsroot/flexml/flexml/testbed In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv2115/testbed Log Message: Directory /cvsroot/flexml/flexml/testbed added to the repository |
From: William D. <wdo...@us...> - 2006-08-15 16:01:21
|
Update of /cvsroot/flexml/flexml In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv23468 Modified Files: skel flexml.pl Log Message: Fix sourceforge bug #1461947: bufferstack memory leak. This fixes both leaks of attributes and leaks of pcdata; also add debug code in skel that prints out bufferstack. Index: skel =================================================================== RCS file: /cvsroot/flexml/flexml/skel,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- skel 10 Aug 2006 19:02:12 -0000 1.32 +++ skel 15 Aug 2006 16:01:13 -0000 1.33 @@ -71,9 +71,7 @@ typedef struct BufferLast_s { struct BufferLast_s *old; const char* saved; char new1[1]; } BufferLast; -#ifdef FLEXML_HasMixed static BufferLast* last = (BufferLast*)0; -#endif static char* next = bufferstack; #define BUFFERSET(P) (P = next) @@ -92,7 +90,6 @@ BUFFERDONE; } -#ifdef FLEXML_HasMixed static void pushbuffer(const char* p) { BufferLast* l = (BufferLast*)next; @@ -111,7 +108,6 @@ next = (char*)l; return l->saved; } -#endif /* General internal entities are `unput' back onto the input stream... */ #define ENTITYTEXT(T) \ @@ -173,6 +169,14 @@ /* Bypass Flex's default INITIAL state and begin by parsing the XML prolog. */ SET(PROLOG); + #ifdef FLEX_DEBUG + { + int i; + for (i = 0; i < FLEXML_BUFFERSTACKSIZE; i++) { + bufferstack[i] = '\377'; + } + } + #endif FLEXML_EXTRA_DEFINITIONS_INIT /* COMMENTS and PIs: handled uniformly for efficiency. */ @@ -298,9 +302,23 @@ va_end(ap); } +void print_bufferstack() +{ + int i; + fputs("Buffer: ", stderr); + for (i = 0; i < FLEXML_BUFFERSTACKSIZE; i++) { + if ( bufferstack[i] == '\377' ) break; + putc(bufferstack[i], stderr); + } + putc('\n', stderr); +} + static void debug_enter(int state, const char* statename) { yy_push_state(state); - if (yy_flex_debug) print_yy_stack("--ENTER(%s) : ",statename); + if (yy_flex_debug) { + print_yy_stack("--ENTER(%s) : ",statename); + print_bufferstack(); + } } static void debug_leave(void) { Index: flexml.pl =================================================================== RCS file: /cvsroot/flexml/flexml/flexml.pl,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- flexml.pl 18 Jul 2006 19:08:58 -0000 1.54 +++ flexml.pl 15 Aug 2006 16:01:13 -0000 1.55 @@ -1215,7 +1215,6 @@ print "#define FLEXML_yylineno\n" if $lineno; print "#define FLEXML_NOFAIL\n" if $nofail; print "#define FLEXML_quiet_parser\n" if $quiet_parser; - print "#define FLEXML_HasMixed\n" if %inmixed; print "#define FLEXML_BUFFERSTACKSIZE $stacksize\n"; print "\n"; @@ -1352,7 +1351,7 @@ for my $attribute (@myattributes) { print " A_${tagprefix}${myctag}_$catt{$attribute} = " . $initof{"$tag/$attribute"} . ";\n"; } - print " ENTER(AL_${tagprefix}$myctag);\n"; + print " ENTER(AL_${tagprefix}$myctag); pushbuffer(NULL);\n"; print " }\n"; # print " . FAIL(\"Unexpected character `%c': `<$tag' expected.\",yytext[0]);\n"; @@ -1426,9 +1425,9 @@ . " FAIL(\"Required attribute `$attribute' not set for `$tag' element.\");\n"; } } - print " LEAVE; STag_${tagprefix}$myctag();" + print " LEAVE; STag_${tagprefix}$myctag(); popbuffer(); " . (%inmixed ? ' pushbuffer('."${tagprefix}".'pcdata);' : '') - . ($mixed{$tag} ? 'BUFFERSET('."${tagprefix}".'pcdata)' : "${tagprefix}".'pcdata = NULL'). ";" + . ($mixed{$tag} ? 'pushbuffer('."${tagprefix}".'pcdata); BUFFERSET('."${tagprefix}".'pcdata);' : "${tagprefix}".'pcdata = NULL'). ";" . " ENTER($startstate{$tag});\n"; print " }\n"; # @@ -1441,7 +1440,7 @@ . " FAIL(\"Required attribute `$attribute' not set for `$tag' element.\");\n"; } } - print " LEAVE; STag_${tagprefix}$myctag();" + print " LEAVE; STag_${tagprefix}$myctag(); popbuffer();" . (%inmixed ? ' pushbuffer('."${tagprefix}".'pcdata);' : '') . " ${tagprefix}".'pcdata = ' . ($mixed{$tag} ? '""' : 'NULL') . ';' . " ETag_${tagprefix}$myctag();" @@ -1470,6 +1469,7 @@ print " LEAVE;\n"; print " BUFFERDONE;\n" if $mixed{$tag}; print " ETag_${tagprefix}$myctag();\n"; + print " ${tagprefix}pcdata = popbuffer();\n" if $mixed{$tag}; print " ${tagprefix}pcdata = popbuffer();\n" if %inmixed; print $exitswitch; print " }\n"; |
From: William D. <wdo...@us...> - 2006-08-10 19:02:16
|
Update of /cvsroot/flexml/flexml In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv10192 Modified Files: skel Log Message: Fix bug https://sourceforge.net/support/tracker.php?aid=1538171. Index: skel =================================================================== RCS file: /cvsroot/flexml/flexml/skel,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- skel 18 Jul 2006 18:21:13 -0000 1.31 +++ skel 10 Aug 2006 19:02:12 -0000 1.32 @@ -289,9 +289,12 @@ { 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]); + if (statenames) { + 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); } |
From: Martin Q. <mqu...@us...> - 2006-07-18 19:13:01
|
Update of /cvsroot/flexml/flexml/debian In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv21010/debian Modified Files: changelog Log Message: Release 1.5.3 Index: changelog =================================================================== RCS file: /cvsroot/flexml/flexml/debian/changelog,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- changelog 18 Jul 2006 12:12:06 -0000 1.26 +++ changelog 18 Jul 2006 19:12:57 -0000 1.27 @@ -1,3 +1,13 @@ +flexml (1.5.3-1) unstable; urgency=low + + * New option: --sysid to override the system id + * Kill any non ascii char from the distrib. They were latin1, I use utf8 + so they annoyed me for not much benefit. I could have switched to utf8, + but it would have annoyed other people, I'm sure. + * Kill the EnlargeFlex.patch: was integrated into flex a few ages ago. + + -- Martin Quinson <mqu...@de...> Tue, 18 Jul 2006 19:40:36 +0200 + flexml (1.5.2-1) unstable; urgency=low * Bug fix: do find the skeleton file in installed distributions |