flex-devel Mailing List for flex: the fast lexical analyser (Page 9)
flex is a tool for generating scanners
Brought to you by:
wlestes
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2007 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
(5) |
May
(2) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(3) |
2008 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
(5) |
Sep
(3) |
Oct
(33) |
Nov
(4) |
Dec
(4) |
2009 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(10) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
2012 |
Jan
|
Feb
(11) |
Mar
(12) |
Apr
|
May
|
Jun
(3) |
Jul
(62) |
Aug
(2) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
2013 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
(3) |
Nov
(33) |
Dec
(31) |
2016 |
Jan
(2) |
Feb
|
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
(2) |
Sep
(5) |
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
(4) |
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Tim L. <ti...@ti...> - 2012-02-24 14:45:15
|
Isaac Dunham <id...@la...> wrote: >> I see that FreeBSD m4 does not provide the -P option at all. >> As a general thing, the m4 dependency is something that will be >> reviewed, although not for a couple flex versions. > .. >> > I grepped through the source for flex, and the only place it used GNUish m4 syntax (--prefix-builtins) was in configure.in / configure >> > NetBSD m4 has -P which does the same thing, so I switched the test to P and it compiled fine. > Would you mind changing the test to accept -P? This would do it: > sed -e 's/prefix-builtins/P/g' -i configure.in configure > FreeBSD could add -P support fairly easily, if they wanted. But > testing for the long form when only the short form can be > cross-platform seems like a rather arbitrary limit, and there are > multiple implementations that use the short form. I replaced the test for GNU M4 with a feature test for "m4 -P" in the attached patch. Could you try it out on NetBSD? (You will have to regenerate "configure" with "autoconf".) Tim |
From: Will E. <wes...@gm...> - 2012-02-22 10:58:33
|
We can certainly look at making the test more portable, yes. On Tuesday, 21 February 2012, 7:57 pm -0800, Isaac Dunham <id...@la...> wrote: > On Tue, 21 Feb 2012 07:22:16 -0500 > Will Estes <wes...@gm...> wrote: > > > I see that FreeBSD m4 does not provide the -P option at all. > > > > As a general thing, the m4 dependency is something that will be > > reviewed, although not for a couple flex versions. > .. > > > I grepped through the source for flex, and the only place it used GNUish m4 syntax (--prefix-builtins) was in configure.in / configure > > > NetBSD m4 has -P which does the same thing, so I switched the test to P and it compiled fine. > > Would you mind changing the test to accept -P? This would do it: > > sed -e 's/prefix-builtins/P/g' -i configure.in configure > > FreeBSD could add -P support fairly easily, if they wanted. But > testing for the long form when only the short form can be > cross-platform seems like a rather arbitrary limit, and there are > multiple implementations that use the short form. > > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Flex-devel mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-devel -- Will Estes (wl...@us...) Flex Project Maintainer http://flex.sourceforge.net/ |
From: Isaac D. <id...@la...> - 2012-02-22 03:58:02
|
On Tue, 21 Feb 2012 07:22:16 -0500 Will Estes <wes...@gm...> wrote: > I see that FreeBSD m4 does not provide the -P option at all. > > As a general thing, the m4 dependency is something that will be > reviewed, although not for a couple flex versions. .. > > I grepped through the source for flex, and the only place it used GNUish m4 syntax (--prefix-builtins) was in configure.in / configure > > NetBSD m4 has -P which does the same thing, so I switched the test to P and it compiled fine. Would you mind changing the test to accept -P? This would do it: sed -e 's/prefix-builtins/P/g' -i configure.in configure FreeBSD could add -P support fairly easily, if they wanted. But testing for the long form when only the short form can be cross-platform seems like a rather arbitrary limit, and there are multiple implementations that use the short form. |
From: Will E. <wes...@gm...> - 2012-02-21 12:22:29
|
I see that FreeBSD m4 does not provide the -P option at all. As a general thing, the m4 dependency is something that will be reviewed, although not for a couple flex versions. We'll clear out the small stuff and then we'll step back and look at the larger issues. On Monday, 20 February 2012, 10:36 pm -0800, Isaac Dunham <id...@la...> wrote: > Hello, > I grepped through the source for flex, and the only place it used GNUish m4 syntax (--prefix-builtins) was in configure.in / configure > NetBSD m4 has -P which does the same thing, so I switched the test to P and it compiled fine. > But it may not necessary to check this at all. > > -- > Isaac Dunham <id...@la...> > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Flex-devel mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-devel -- Will Estes <wes...@gm...> Flex Project Maintainer http://flex.sourceforge.net/ |
From: Aaron S. <aa...@se...> - 2012-02-21 07:21:49
|
My m4's help reads: -P, --prefix-builtins force a `m4_' prefix to all builtins Does the NetBSD m4 simply not provide the long form of the option? On Mon, Feb 20, 2012 at 10:36 PM, Isaac Dunham <id...@la...> wrote: > Hello, > I grepped through the source for flex, and the only place it used GNUish m4 syntax (--prefix-builtins) was in configure.in / configure > NetBSD m4 has -P which does the same thing, so I switched the test to P and it compiled fine. > But it may not necessary to check this at all. > > -- > Isaac Dunham <id...@la...> > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Flex-devel mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-devel |
From: Isaac D. <id...@la...> - 2012-02-21 06:37:16
|
Hello, I grepped through the source for flex, and the only place it used GNUish m4 syntax (--prefix-builtins) was in configure.in / configure NetBSD m4 has -P which does the same thing, so I switched the test to P and it compiled fine. But it may not necessary to check this at all. -- Isaac Dunham <id...@la...> |
From: Will E. <wes...@gm...> - 2012-02-17 21:48:26
|
This has been fixed in the flex cvs tree, and the relevant sourceforge bug items closed. On Wednesday, 8 February 2012, 8:53 pm +0000, Tim Landscheidt <ti...@ti...> wrote: > Hi Will, > > > Autoconf could test for isatty's declaration/presence and we could > > conditionally define it if need be. > > > I'm not convinced that it's still an issue, though, so my preference is > > just to remove the isatty declaration. > > [...] > > But the scanner can get generated on one machine and compil- > ed on another. flex is the prime example for this: scan.c > is generated at release on the maintainer's box and compiled > on every supported platform. Other projects might not even > use autoconf. > > Anyway, attached is a patch to remove this. > > Tim > > P. S.: Please keep discussions public if possible so that > others can chip in. > From 534ff13e77ea60b3b83b155d20ac6b5f18c9a821 Mon Sep 17 00:00:00 2001 > From: Tim Landscheidt <ti...@ti...> > Date: Wed, 8 Feb 2012 20:39:08 +0000 > Subject: [PATCH] Remove own declaration of isatty(). > > This fixes bugs #1984987 and #2705528. > --- > flex.skl | 19 ------------------- > 1 files changed, 0 insertions(+), 19 deletions(-) > > diff --git a/flex.skl b/flex.skl > index 60c141f..6285def 100644 > --- a/flex.skl > +++ b/flex.skl > @@ -2055,25 +2055,6 @@ static void yy_load_buffer_state YYFARGS0(void) > } > > > -%if-c-only > -m4_ifdef( [[M4_YY_ALWAYS_INTERACTIVE]],, > -[[ > - m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]],, > - [[ > -#ifndef __cplusplus > -extern int isatty M4_YY_PARAMS( int ); > -#endif /* __cplusplus */ > - ]]) > -]]) > -%endif > - > -%if-c++-only > -m4_ifdef( [[M4_YY_NEVER_INTERACTIVE]],, > -[[ > -extern "C" int isatty M4_YY_PARAMS( int ); > -]]) > -%endif > - > /* Initializes or reinitializes a buffer. > * This function is sometimes called more than once on the same buffer, > * such as during a yyrestart() or at EOF. > -- > 1.6.2.5 > |
From: Tim L. <ti...@ti...> - 2012-02-06 12:56:51
|
Will Estes <wes...@gm...> wrote: > At this point, we also have autoconf magic to play with, so if we need > to do something, that's probably the right level to use rather than > doing it in the flex sources directly. > [...] How does or should autoconf affect the scanner generated by flex.skl? Tim |
From: Will E. <wes...@gm...> - 2012-02-06 12:05:41
|
Tim, At this point, we also have autoconf magic to play with, so if we need to do something, that's probably the right level to use rather than doing it in the flex sources directly. On Monday, 6 February 2012, 11:45 am +0000, Tim Landscheidt <ti...@ti...> wrote: > Hi, > > AFAICS, Vern added the declaration of isatty() in > http://flex.cvs.sourceforge.net/viewvc/flex/flex/flex.skl?r1=2.72&r2=2.73. > There are two bug reports concerning this where basically > flex's declaration clashes with unistd.h's that adds a > "__THROW" for C++. > > Is there any harm in replacing flex's declaration alto- > gether by "#include <unistd.h>"? I. e., are there used tar- > get platforms that require flex itself to declare isatty? > > Tim > > ------------------------------------------------------------------------------ > Try before you buy = See our experts in action! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-dev2 > _______________________________________________ > Flex-devel mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-devel |
From: Tim L. <ti...@ti...> - 2012-02-06 11:45:46
|
Hi, AFAICS, Vern added the declaration of isatty() in http://flex.cvs.sourceforge.net/viewvc/flex/flex/flex.skl?r1=2.72&r2=2.73. There are two bug reports concerning this where basically flex's declaration clashes with unistd.h's that adds a "__THROW" for C++. Is there any harm in replacing flex's declaration alto- gether by "#include <unistd.h>"? I. e., are there used tar- get platforms that require flex itself to declare isatty? Tim |
From: John P. H. <jph...@gm...> - 2011-12-29 14:06:20
|
On Ubuntu 11.4 with flex 2.5.35, the subject function crashes if no start condition has been stacked. The offending statement is return (yy_start_stack)[(yy_start_stack_ptr) - 1]; yy_stack_ptr is 0. Should yy_top_state return 0 or -1 when there is nothing on the stack? |
From: John P. H. <jph...@gm...> - 2011-11-05 15:21:01
|
REJECT does not decrement yylineno when backing up over a newline. The attached self-contained test case shows what I believer to be an error. |
From: John P. H. <jph...@gm...> - 2011-10-29 08:53:51
|
On a clean install of Fedora 15 with GCC and Bison, make check fails two c++ test cases, both because the EOF macro is undefined (the unicode quotes use by gcc are messe up here): make[5]: Entering directory `/usr/src/flex-2.5.35/tests/test-c++-basic' ../../flex -+ scanner.l g++ -c -o scanner.o -I. -I../.. -I../.. -g -O2 scanner.cpp scanner.cpp: In member function ‘int testFlexLexer::yyinput()’: scanner.cpp:1125:14: error: ‘EOF’ was not declared in this scope make[5]: *** [scanner.o] Error 1 make[5]: Leaving directory `/usr/src/flex-2.5.35/tests/test-c++-basic' make[5]: Entering directory `/usr/src/flex-2.5.35/tests/test-c++-multiple-scanners' ../../flex -+ scanner-1.l g++ -c -o scanner-1.o -I. -I../.. -I../.. -g -O2 scanner-1.cpp scanner-1.cpp: In member function ‘int S1_FlexLexer::yyinput()’: scanner-1.cpp:1156:14: error: ‘EOF’ was not declared in this scope make[5]: *** [scanner-1.o] Error 1 make[5]: Leaving directory `/usr/src/flex-2.5.35/tests/test-c++-multiple-scanners' |
From: Peter G. <pe...@2n...> - 2011-08-18 09:49:18
|
Hi, I can report that Peter's patch prevents this warning from ever appearing. It would be great if a committer could check it out. Thanks -- Peter Geoghegan http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services |
From: Peter M. <pet...@gm...> - 2011-08-16 01:28:32
|
Okay, a couple more things to check (sorry for all the time this is taking!) The file src/Makefile.global is where postgres defines FLEX - can you make sure that's there and pointing to the right one? If you had flex in two different directories in your PATH, it would use the first one who's version is 2.5.(31+), and skip the one that had 2.6.0. (Maybe I should have kept it at 2.5.36!) Also, my working copy of postgresql's configure has this modification to make sure it doesn't skip 2.6.0 --- a/configure 2011-04-14 23:15:53.000000000 -0400 +++ b/configure 2011-08-14 00:07:47.000000000 -0400 @@ -6777,7 +6777,7 @@ echo '%%' > conftest.l if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then pgac_flex_version=`$pgac_candidate --version 2>/dev/null` - if echo "$pgac_flex_version" | sed 's/[.a-z]/ /g' | $AWK '{ if ($1 = 2 && $2 = 5 && $3 >= 31) exit 0; else exit 1;}' + if echo "$pgac_flex_version" | sed 's/[.a-z]/ /g' | $AWK '{ if ($1 == 2 && $2 == 5 && $3 >= 31) exit 0; else if ($1 == 2 && $2 > 5) exit 0; else exit 1;}' then pgac_cv_path_flex=$pgac_candidate break 2 On Mon, Aug 15, 2011 at 6:13 PM, Peter Geoghegan <pe...@2n...>wrote: > On 15 August 2011 22:59, Peter Martini <pet...@gm...> wrote: > > Can you confirm scan.c was regenerated? I believe if postgres doesn't > find a supported flex it uses the one included in the postgresql source > instead of regenerating it. There's a check in configure to see if flex $1 > = 2 and $2 = 5 and $3 >= 31 which should be == in both places and also add a > check if $1 == 2 && $2 > 5. > > > > Forgive me. scan.c was not regenerated, despite a "make distclean". I > have manually rm'd scan.c, and tried again. However, the warning is > still seen, in exactly the same context: > > /* yy_try_NUL_trans - try to make a transition on the NUL character > * > * synopsis > * next_state = yy_try_NUL_trans( current_state ); > */ > static yy_state_type yy_try_NUL_trans (yy_state_type > yy_current_state , yyscan_t yyscanner) > { > register int yy_is_jam; > struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var > may be unused depending upon options. */ > > register int yy_c = 256; > register yyconst struct yy_trans_info *yy_trans_info; > > yy_trans_info = &yy_current_state[(unsigned int) yy_c]; > yy_current_state += yy_trans_info->yy_nxt; > yy_is_jam = (yy_trans_info->yy_verify != yy_c); > > return yy_is_jam ? 0 : yy_current_state; > } > > Thanks > > -- > Peter Geoghegan http://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Training and Services > |
From: Peter G. <pe...@2n...> - 2011-08-15 22:13:10
|
On 15 August 2011 22:59, Peter Martini <pet...@gm...> wrote: > Can you confirm scan.c was regenerated? I believe if postgres doesn't find a supported flex it uses the one included in the postgresql source instead of regenerating it. There's a check in configure to see if flex $1 = 2 and $2 = 5 and $3 >= 31 which should be == in both places and also add a check if $1 == 2 && $2 > 5. > Forgive me. scan.c was not regenerated, despite a "make distclean". I have manually rm'd scan.c, and tried again. However, the warning is still seen, in exactly the same context: /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) { register int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ register int yy_c = 256; register yyconst struct yy_trans_info *yy_trans_info; yy_trans_info = &yy_current_state[(unsigned int) yy_c]; yy_current_state += yy_trans_info->yy_nxt; yy_is_jam = (yy_trans_info->yy_verify != yy_c); return yy_is_jam ? 0 : yy_current_state; } Thanks -- Peter Geoghegan http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services |
From: Peter M. <pet...@gm...> - 2011-08-15 22:05:19
|
Oh, and if you have multiple versions of flex, it'll check all of them until it finds a supported version Sent from my iPhone On Aug 15, 2011, at 17:33, Peter Geoghegan <pe...@2n...> wrote: > Thanks for your efforts Peter. > > I'm disappointed to report that it does not. Here is the context of > the warning, within scan.c: > > /* yy_try_NUL_trans - try to make a transition on the NUL character > * > * synopsis > * next_state = yy_try_NUL_trans( current_state ); > */ > static yy_state_type yy_try_NUL_trans (yy_state_type > yy_current_state , yyscan_t yyscanner) > { > register int yy_is_jam; > struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var > may be unused depending upon options. */ > > register int yy_c = 256; > register yyconst struct yy_trans_info *yy_trans_info; > > yy_trans_info = &yy_current_state[(unsigned int) yy_c]; > yy_current_state += yy_trans_info->yy_nxt; > yy_is_jam = (yy_trans_info->yy_verify != yy_c); > > return yy_is_jam ? 0 : yy_current_state; > } > > Perhaps that helps? > > Thanks > -- > Peter Geoghegan http://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Training and Services |
From: Peter M. <pet...@gm...> - 2011-08-15 22:00:01
|
Can you confirm scan.c was regenerated? I believe if postgres doesn't find a supported flex it uses the one included in the postgresql source instead of regenerating it. There's a check in configure to see if flex $1 = 2 and $2 = 5 and $3 >= 31 which should be == in both places and also add a check if $1 == 2 && $2 > 5. Sent from my iPhone On Aug 15, 2011, at 17:33, Peter Geoghegan <pe...@2n...> wrote: > Thanks for your efforts Peter. > > I'm disappointed to report that it does not. Here is the context of > the warning, within scan.c: > > /* yy_try_NUL_trans - try to make a transition on the NUL character > * > * synopsis > * next_state = yy_try_NUL_trans( current_state ); > */ > static yy_state_type yy_try_NUL_trans (yy_state_type > yy_current_state , yyscan_t yyscanner) > { > register int yy_is_jam; > struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var > may be unused depending upon options. */ > > register int yy_c = 256; > register yyconst struct yy_trans_info *yy_trans_info; > > yy_trans_info = &yy_current_state[(unsigned int) yy_c]; > yy_current_state += yy_trans_info->yy_nxt; > yy_is_jam = (yy_trans_info->yy_verify != yy_c); > > return yy_is_jam ? 0 : yy_current_state; > } > > Perhaps that helps? > > Thanks > -- > Peter Geoghegan http://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Training and Services |
From: Peter G. <pe...@2n...> - 2011-08-15 21:35:54
|
I should add that the configure script even complained about an unsupported version of flex (a devel flex is not expected), and so I am confident that I tested your patch correctly - I cloned the repo that you named. -- Peter Geoghegan http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services |
From: Peter G. <pe...@2n...> - 2011-08-15 21:33:47
|
Thanks for your efforts Peter. I'm disappointed to report that it does not. Here is the context of the warning, within scan.c: /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) { register int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ register int yy_c = 256; register yyconst struct yy_trans_info *yy_trans_info; yy_trans_info = &yy_current_state[(unsigned int) yy_c]; yy_current_state += yy_trans_info->yy_nxt; yy_is_jam = (yy_trans_info->yy_verify != yy_c); return yy_is_jam ? 0 : yy_current_state; } Perhaps that helps? Thanks -- Peter Geoghegan http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services |
From: Peter M. <pet...@gm...> - 2011-08-15 20:33:25
|
Hi, I've been playing around with adding Unicode support to flex https://github.com/PeterMartini/flex, and added a small patch to fix your issue with commits <https://github.com/PeterMartini/flex/commit/62932e76a822c6b299c4f2d3f51e41191e432f4d>62932e7 and f328641. Since all of the Unicode features are hiding behind switches/option statements, the runtime/generated output for whatever switches you're using to generate that code should be identical to what flex 2.5.35 generated, except of course with that compiler warning suppressed. I confirmed with postgresql-9.0.4 that the the only difference in the generated assembly is the line numbering. I'm not privileged to check in to flex's official CVS, but would you mind trying https://github.com/PeterMartini/flex anyway to confirm that everything runs on your platform(s) and that the warning goes away? My repo has the version of flex as 2.6.0 though, which postgresql's configure thinks is too old (only checking the 3rd digit), so that'll have to be tweaked for it to run. FLEX-DEVEL: If that patch works for him, the generated diff should apply cleanly to the current CVS tree as well - the only times I touched flex.skl was for this fix. On Tue, Aug 9, 2011 at 3:06 PM, Peter Geoghegan <pe...@2n...>wrote: > Hi, > > I'm re-posting this e-mail to this list, because I had no luck with > -help. I hope that's okay. > > The following warning is seen when building PostgreSQL: > > In file included from gram.y:12962:0: > scan.c: In function ‘yy_try_NUL_trans’: > scan.c:16246:23: warning: unused variable ‘yyg’ [-Wunused-variable] > > This refers to this variable: > > struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may > be unused depending upon options. */ > > This is a known problem with Flex. I'd be really grateful is someone > could figure out a way of fixing this - the responsibility to fix the > warning, which is seen on every compiler, clearly lies with Flex > itself. We can't do anything about it, much as we'd like to. If an > elegant solution doesn't present itself, surely it can't be a problem > to tack on some code that will be optimised away to suppress the > warning? Surely that's better than having everyone wonder why this > warning is seen time and again? > > Thanks > > -- > Peter Geoghegan http://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Training and Services > > > ------------------------------------------------------------------------------ > uberSVN's rich system and user administration capabilities and model > configuration take the hassle out of deploying and managing Subversion and > the tools developers use with it. Learn more about uberSVN and get a free > download at: http://p.sf.net/sfu/wandisco-dev2dev > _______________________________________________ > Flex-devel mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-devel > |
From: Peter G. <pe...@2n...> - 2011-08-09 20:07:10
|
Hi, I'm re-posting this e-mail to this list, because I had no luck with -help. I hope that's okay. The following warning is seen when building PostgreSQL: In file included from gram.y:12962:0: scan.c: In function ‘yy_try_NUL_trans’: scan.c:16246:23: warning: unused variable ‘yyg’ [-Wunused-variable] This refers to this variable: struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ This is a known problem with Flex. I'd be really grateful is someone could figure out a way of fixing this - the responsibility to fix the warning, which is seen on every compiler, clearly lies with Flex itself. We can't do anything about it, much as we'd like to. If an elegant solution doesn't present itself, surely it can't be a problem to tack on some code that will be optimised away to suppress the warning? Surely that's better than having everyone wonder why this warning is seen time and again? Thanks -- Peter Geoghegan http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services |
From: Peter M. <pet...@gm...> - 2011-08-09 15:55:59
|
Hi, I'm working on patching flex to add true Unicode support. So far, I have UTF-8 encoding working, \u[0-9a-fA-F]{4} and \U[0-9a-fA-F]{8}, the '.' matching all code points from 0 to 0x10ffff, and switches to enable/disable UTF-8 via commandline (--utf8), directive (%option utf8), and pattern modifier (?u:). On my todo list still is proper case insensitive matching, UTF-16 support (*not* wide chars, true support, including surrogate handling and possibly some mechanism to handle BOMs/endianness), property handling, \x and \X escapes for grapheme matches. My current work is here: http://github.com/PeterMartini/flex. I know there have been various patches suggested for Unicode support before, so if anyone who's worked on those would care to comment, please drop me a line / respond to this / fork my github repo! I'd love to get this support into flex, if its still being maintained. Regards, Peter Martini |
From: tuxdna <tu...@gm...> - 2011-05-20 18:37:49
|
I found a minor typo with flex documentation in info page 18 - Generating C++ Scanners Please find the patch attached with this email to fix it. /tuxdna |
From: Dmitri G. <gri...@gm...> - 2009-10-19 04:47:23
|
Hi, I've written a program that might be useful for people writing scanners with UTF-8 input. (See attachment) /* * This program produces lex(1)-compatible regular expressions that will match * any of specified Unicode code points in UTF-8. Code points can be either * enumerated or specified by their General_Category. * * lex(1) doesn't know anything about Unicode, but it is 8-bit clean. So we * construct regular expressions that match UTF-8 byte sequences (that encode * needed Unicode code points). In this way we can get a lexer that works with * UTF-8 input, but doesn't know anything about Unicode. * * To make lexer aware of any Unicode Transformation Format we need to write a * wrapper that converts any UTF to UTF-8 and feeds the result to the UTF-8 * lexer. * * This program is supposed to be conforming to Unicode 5.2.0 (but I don't have * a proof of that). */ /* * To compile: install libicu-dev. Then run: * g++ -W -Wall -std=c++0x gen_utf-8_regexp.cc $(icu-config --ldflags) */ For example: A specified category: $ ./gen_utf-8_regexp Space_Separator ([\x20]|(\xc2\xa0)|(\xe1\x9a\x80|\xe1\xa0\x8e|\xe2\x80[\x80-\x8a]|\xe2\x80\xaf|\xe2\x81\x9f|\xe3\x80\x80)) A specified code point: $ ./gen_utf-8_regexp -c 2192 ((\xe2\x86\x92)) Multiple categories or code points can be specified. It could be useful for flex users if this program would be included in flex distribution. I'm free for suggestions. Best regards, Dmitri Gribenko -- main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gri...@gm...>*/ |